Toward self-organizing linear search

  • Authors:
  • Gaston H. Gonnet;J. Ian Munro;Hendra Suwanda

  • Affiliations:
  • -;-;-

  • Venue:
  • SFCS '79 Proceedings of the 20th Annual Symposium on Foundations of Computer Science
  • Year:
  • 1979

Quantified Score

Hi-index 0.00

Visualization

Abstract

We consider techniques for adapting linear lists so that the more frequently accessed elements are found near the front, even though we are not told the probabilities of various elements being accessed. The main results are discussed in two sections. Perhaps the most interesting deals with techniques which move an element toward the front only after it has been requested k times in a row. The other, technically more difficult, section deals with the analysis of the heuristic which moves an element to the head of the list each time it is accessed. The behaviour of this scheme under a number of interesting probability distributions is discussed. Two basic approaches to the technique of moving an element forward after it has been accessed k times in a row are discussed. The first performs the transformation after any k identical requests. The second essentially groups requests into batches of at least k, and performs the action only if the last k requests of a batch are the same. Adopting as the transformation, the moving of the requested element to the front of the list, the second approach is shown to lead to faster average search time under all nontrivial probability distributions for k ≥2. It is also shown that the "periodic" approach, with k = 2, never leads to an average search time greater than 1.21.. times that of the optimal ordering. For the more direct approach, a ratio of 1.36.. is shown under the same constraints. In studying the simple move to front heuristic (i.e. k = 1), it is shown that for a particular distribution this scheme can lead to an average number of probes π/2 times that of the optimal order. Within an interesting class of distributions, this is shown to be the worst average behaviour.