0% found this document useful (0 votes)
737 views3 pages

Fibonacci Search Technique

Fibonacci search is a divide and conquer algorithm that uses Fibonacci numbers to search sorted arrays more efficiently than binary search in some cases. It examines locations with lower dispersion than binary search, which can provide faster access for non-uniform memory structures like magnetic tapes. The algorithm initializes pointers based on Fibonacci numbers and recursively discards portions of the array until finding a match or determining the item is not present. Fibonacci search has the same asymptotic runtime as binary search but can offer improvements for certain memory configurations.

Uploaded by

lakshmirevel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
737 views3 pages

Fibonacci Search Technique

Fibonacci search is a divide and conquer algorithm that uses Fibonacci numbers to search sorted arrays more efficiently than binary search in some cases. It examines locations with lower dispersion than binary search, which can provide faster access for non-uniform memory structures like magnetic tapes. The algorithm initializes pointers based on Fibonacci numbers and recursively discards portions of the array until finding a match or determining the item is not present. Fibonacci search has the same asymptotic runtime as binary search but can offer improvements for certain memory configurations.

Uploaded by

lakshmirevel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Fibonacci search technique

Fibonacci search technique


In computer science, the Fibonacci search technique is a method of searching a sorted array using a divide and conquer algorithm that narrows down possible locations with the aid of Fibonacci numbers. Compared to binary search, Fibonacci search examines locations whose addresses have lower dispersion. Therefore, when the elements being searched have non-uniform access memory storage (i.e., the time needed to access a storage location varies depending on the location previously accessed), the Fibonacci search has an advantage over binary search in slightly reducing the average time needed to access a storage location. The typical example of non-uniform access storage is that of a magnetic tape, where the time to access a particular element is proportional to its distance from the element currently under the tape's head. Note, however, that large arrays not fitting in CPU cache or even in RAM can also be considered as non-uniform access examples. Fibonacci search has a complexity of O(log(x)) (see Big O notation). Fibonacci search was first devised by Kiefer (1953) as a minimax search for the maximum (minimum) of a unimodal function in an interval.

Algorithm
Let k be defined as an element in F, the array of Fibonacci numbers. n = Fm is the array size. If the array size is not a Fibonacci number, let Fm be the smallest number in F that is greater than n. The array of Fibonacci numbers is defined where Fk+2 = Fk+1+Fk, when k0, F1 =1, and F0 =0. To test whether an item is in the list of ordered numbers, follow these steps: 1. 2. 3. 4. 5. Set k = m. If k = 0, stop. There is no match; the item is not in the array. Compare the item against element in Fk1. If the item matches, stop. If the item is less than entry Fk1, discard the elements from positions Fk1+1 to n. Set k=k1 and return to step 2. 6. If the item is greater than entry Fk1, discard the elements from positions 1 to Fk1. Renumber the remaining elements from 1 to Fk2, set k=k2, and return to step2. Alternative implementation (from "Sorting and Searching" by Knuth): Given a table of records R1, R2, ..., RN whose keys are in increasing order K1 < K2 < ... < KN, the algorithm searches for a given argument K. Assume N+1 = Fk+1 Step 1. [Initialize] i Fk, p Fk-1, q Fk-2 (throughout the algorithm, p and q will be consecutive Fibonacci numbers) Step 2. [Compare] If K < Ki, go to Step 3; if K > Ki go to Step 4; and if K = Ki, the algorithm terminates successfully. Step 3. [Decrease i] If q=0, the algorithm terminates unsuccessfully. Otherwise set (i, p, q) (i - q, q, p - q) (which moves p and q one position back in the Fibonacci sequence); then return to Step 2 Step 4. [Increase i] If p=1, the algorithm terminates unsuccessfully. Otherwise set (i,p,q) (i + p, p p - q, q 2q - p) (which moves p and q two positions back in the Fibonacci sequence); and return to Step 2

Fibonacci search technique

References
J. Kiefer, "Sequential minimax search for a maximum", Froc. American Mathematical Society, 1953. David E. Ferguson, "Fibonaccian searching", Communications of the ACM, vol. 3, is. 12, p.648, Dec. 1960. Manolis Lourakis, "Fibonaccian search in C". [1]. Retrieved January 18, 2007. Implements Ferguson's algorithm. Donald E. Knuth, "The Art of Computer Programming (second edition)", vol. 3, p.418, Nov. 2003.

References
[1] http:/ / www. ics. forth. gr/ ~lourakis/ fibsrch/

Article Sources and Contributors

Article Sources and Contributors


Fibonacci search technique Source: http://en.wikipedia.org/w/index.php?oldid=600625299 Contributors: 5theye, Alpha Ursae Minoris, Avalcarce, Bocutadriansebastian, Brick Thrower, Cataxxx, ChrisGualtieri, Czarkoff, DJAMP4444, David Eppstein, Dia^, Escape Orbit, Finell, Gandalf61, Katieh5584, Logophilus, Lourakis, Michael Hardy, Mounica93, Nasnema, Shuroo, Staafl, ToBeFree, Warrickball, , 21 anonymous edits

License
Creative Commons Attribution-Share Alike 3.0 //creativecommons.org/licenses/by-sa/3.0/

You might also like