AI Glossary / Graphs and symbolic AI / Intermediate
Finger search
Definition
Finger search is searching an ordered collection from a known nearby position, called a finger, rather than always starting from the collection's global entry point. Suitable data structures let the cost depend on the target's distance in sorted order from that finger.
What it means
The finger references an element or position used by the search. It might be the result of a previous lookup or a location supplied by another operation. The relevant distance usually counts positions in sorted order, not the numerical difference between key values or the physical distance between memory addresses.
This is an exact ordered-lookup technique. Its advantage depends on the data structure supporting efficient movement from the finger and on requests having useful locality. Starting from an arbitrary pointer in an ordinary tree does not automatically provide a logarithmic bound in nearby rank distance.
How it works
First compare the target with the finger's key to determine the direction of search, or finish immediately if they match. The search then establishes a region containing the target and narrows it using the collection's ordered structure.
One way to illustrate the idea in an indexed array is to expand probe distances geometrically from the finger, then binary-search the bracket. Specialized finger search trees instead maintain structural information that supports local-to-larger-region navigation and subsequent descent. Guarantees depend on the implementation.
For structures with the standard logarithmic finger-search property, a query can take O(log(d + 1)) time, with a constant-time convention for a zero-distance match, where d measures rank separation. This is an asymptotic bound, not an exact comparison count. Finding or maintaining the finger, handling updates and accessing external storage may add costs that must be considered separately.
Three practical examples
1. A user browses nearby entries in an ordered catalog. A retained position can support subsequent lookups near the current entry, provided the catalog's data structure exposes an appropriate search operation.
2. An algorithm merges ordered collections and repeatedly seeks values close to its previous location. Finger search can exploit that pattern rather than restarting every lookup from the beginning or root.
3. A geometric algorithm maintains an ordered set of objects while local changes occur. A known neighboring element can be useful for locating an update position, with correctness depending on the maintained ordering.
Think of it this way
Think of keeping a bookmark in a dictionary while looking up several nearby words. The bookmark gives you a useful starting place, and you widen your search only when necessary. The analogy captures locality, but an algorithm needs explicit navigation rules. Simply possessing a bookmark does not tell you how many page turns are required or guarantee that the next word is nearby.
Worked example
Consider a sorted array containing the values 10, 20, 30 and so on through 200, with one-based positions. A finger points to position 10, whose value is 100. We want to find 130 at position 13.
In an illustrative rightward doubling search, compare the target with positions one, two and four steps beyond the finger. Position 11 contains 110 and position 12 contains 120, both below the target. Position 14 contains 140, above the target. Therefore the target, if present, lies after position 12 and before position 14. Checking position 13 finds 130.
The rank distance from the finger is three positions, while the key-value difference is thirty. If the same keys were relabeled as 1,000, 2,000 and so forth, the rank distance and probe pattern would be unchanged even though numerical gaps grew. This hand trace demonstrates bracketing from a finger in an array; it is not an execution trace of a particular finger search tree or a universal comparison count.
Illustrative case study
Fictional case study: Cedar Browse observes that a review tool often accesses neighboring catalog entries. Its developers prototype a retained search position but also test large jumps between distant keys. The local pattern helps explain when a finger could be useful, while distant jumps establish the need for a dependable general search path.
The team also checks deletion of the bookmarked entry. It defines how references remain valid or are replaced before measuring performance. The case illustrates workload and reference-lifetime considerations, without claiming a deployed speed improvement.
Common misconceptions and mistakes
The distance measure is not usually the difference between numeric key values. Dense and sparse key ranges can have the same rank distance. Also, locality is a workload property: a sequence of unrelated queries may offer little benefit from the previous result.
Do not assume that walking one neighbor at a time provides logarithmic finger search; that simple walk can require work proportional to d. A rank-sensitive logarithmic guarantee requires a suitable search method and structure. Finally, an invalidated or stale finger can compromise correctness, so update behavior belongs in the design rather than being treated as a minor optimization detail.
Business use
Finger search is relevant when ordered lookups cluster around known positions, such as interactive browsing or algorithms processing nearly ordered data. Measure the distribution of rank distances, not just collection size, to understand whether the access pattern suits the technique.
Check the implementation's guarantees and account for finger maintenance, updates, memory overhead and concurrency. Compare against the existing ordered index on both local and distant queries. If the interface exposes cursors, determine whether those cursors merely support sequential iteration or actually enable the desired search bound. Terminology alone cannot establish equivalent functionality.
People also ask
Must the finger be the previous result?
No. It can be any valid starting reference supported by the structure, including one supplied by another operation.
Does a nearby numerical value guarantee a cheap search?
Not necessarily. Many stored keys can lie between two numerically close values; rank distance is the relevant measure in the usual bound.
Is finger search limited to trees?
No. The general idea can be implemented in different ordered structures, though their guarantees and update costs differ.
Check your understanding
If a target is three positions beyond the finger but its key is one million larger, which distance matters in the usual finger-search bound?
Answer: The three-position rank separation. The numerical gap does not count how many stored elements separate the two positions.
Related terms
- Finger search tree
- Rank
- Exponential search
- Binary search
- ordered set
- cursor
- locality of reference
- balanced search tree
Learn next
Trace a doubling search from a known position in an array. Then examine how a finger search tree supports similar rank-sensitive access while handling insertions and deletions, keeping search cost separate from update cost.
More in Graphs and symbolic AI
- Fibonacci search technique - The Fibonacci search technique locates a value in a sorted array by using Fibonacci numbers to choose successive comparison positions.
- FIFO queue - A FIFO queue is a collection in which items are removed in the order they were added. FIFO stands for first in, first out.
- Fine-motion planning - Fine-motion planning is the design of robot motion strategies for precise tasks where contact, sensing and positioning uncertainty matter.
- Finite horizon - A finite horizon is a limited span of future stages over which a decision process is evaluated or planned.
- First-choice hill climbing - First-choice hill climbing is a local-search method that samples neighboring solutions and moves to the first one that improves the current objective.
- First-order logic - First-order logic is a formal language for describing objects, their properties and relationships, and statements quantified over those objects.
Sources
Primary source: Brodal and colleagues, “Optimal Finger Search Trees in the Pointer Machine”: https://cs.au.dk/~gerth/papers/jcss03.pdf . The source supports the finger and distance-sensitive search concepts. The array trace and fictional case are original illustrations, not demonstrations of the paper's full data structure.
Previous: Fine-tuning Next: Finger search tree