22 views

Uploaded by anand

uuuuuuuuuu

- AssetManagement Manual 20130206
- Stack
- 40review(JTableJTree)
- FSP-Paper
- Pipe-Routing Algorithm_Case study.pdf
- Computer Notes - Data Structures - 29
- AVL-Trees
- hw2sol
- Trees1x1
- DME_Payment Config Document
- Data Structure
- Union Find
- cs344-lect2-3-Astar-2012-1-3-5
- iyuitnt
- drm_user
- RapidMiner 5.2 Advanced Charts English v1.0
- Applying-R-Trees-In-Non-Spatial-Multidimensional-Databases-.pdf
- 75311712-MC0080-SMU-2011
- Practice Final CS61c
- Play With Trees Solution

You are on page 1of 14

of a sorted array with the help of Fibonacci

numbers.

Fibonacci number is subtracted from the index

thereby reducing the size of the list.

Fibonacci search is a process of searching a

sorted array by utilizing divide and conquer

algorithm.

Fibonacci search has a complexity of O(log(x))

Fibonacci Search

The Fibonacci number sequence is given by

{0,1,1,2,3,5,8,13,21,.} and is generated by

the following recurrence relation

F0 = 0

F1 = 1

Fi = Fi-1 + Fi-2

The fibonacci sequence finds an application in

a search technique termed fibonacci search

Fibonacci Search

Binary search selects the median of the sublist

as its next element for comparison, the

fibonacci search determines the next element

of comparison as dictated by the fibonacci

number sequence

Fibonacci search works only on ordered lists

The number of elements in the list is one less

than a fibonacci number

n = Fk-1

Decision Tree for Fibonacci Search

The decision tree from Fibonacci search satisfies

the following characteristics

If we consider a grandparent, parent and its child

nodes and if the difference in index between the

grandparent and parent is Fk then

(i) If the parent is a left child node then the

difference in index between the parent and its

child nodes is Fk-1, whereas

(ii) If the parent is a right child node then the

difference in index between the parent and the

child nodes is Fk-2

Decision Tree for Fibonacci Search

Consider an ordered list L={K1, K2,Kn} where

K1 < K2 < Kn where n = Fk-1

The fibonacci search decision tree for n=20

where 20 = (F8-1) is shown in figure

The root of the decision tree which is the first

element in the list to be compared with key K

during the search is that key Ki whose index i is

the closest fibonacci sequence number to n

In the case of n=20, K13 is the root since the

closest fibonacci number to n=20 is 13.

Decision Tree for Fibonacci Search

K13

K8 K18

K2 K4 K6 K9 K14

K1

Decision Tree for Fibonacci Search

Algorithm illustarates the procedure for

fibonacci search

N is the number of data elements is such that

(i) Fk+1 > (n+1) and

(ii) Fk = (n+1) for some m>=0 where Fk+1 and Fk

are two consecutive fibonacci numbers

Algorithm for Fibonacci Search

Procedure Fibonacci_search(L,n,K)

// L(1:n) is a linear ordered (non decreasing) list of data

elements. N is such that Fk+1>(n+1). Also Fk+m=(n+1). K

is the key to be searched in the list //

Obtain the largest fibonacci number Fk closest to n+1

p= Fk-1

q=Fk-2

r=Fk-3

m=(n+1) (p+q)

If (K>L(p)) then p=p+m

Found=false

Algorithm for Fibonacci Search

While ((P<>0) and (not found)) do

Case

: K=L[p] { print (key found);

found=true;

}

: K <L[p] : if (r=0) then p=0

else {p=p-r; t=q; q=r; r=t-r;}

: K > L[p] : if (q=1) then p=0

else {p=p+r; q=q-r; r=r-q}

Endcase

Endwhile

If (found=false) then print (key not found);

End fibonacci_search.

Algorithm for Fibonacci Search

Let us search for the key K=434

L=(2,4,8,9,17,36,44,55,81,84,94,116,221,256,3

02,256,396,401,434,536)

N=20, the number of elements is such that (i)

F9 > n+1 and (ii) F8+m = (n+1) where m=0 and

n=20

The algorithm for fibonacci search first obtains

the largest fibonacci number closest to n+1. ie

F8 in this case.

Algorithm for Fibonacci Search

It compares K=434 with the data element with index F7

i.e.L[13]=221

Since K>L[13] the search list is reduced to

L[14:20]={256,302,356,396,401,434,536}

Now K compares itself with L[18]=401. Since K>L[18]

the search list is further reduced to L[19:20]={434,536}

Now K is compared with L[20]=536. Since K<L[20] is

true it results in the search list {434} which when

searched yields the search key.

The key is successfully found

Following a similar procedure, searching for 66 in the

list yields an unsuccessful search

Algorithm for Fibonacci Search

Search < t p q r Remarks

key K K=L[p]

>

434 13 8 5 n=20

m=0 since

F8+0=n+1

K > L[13] = 221 13 8 5 Since K > L[p]

p=p+m

K > L[13] = 221 18 3 2

K > L[18} = 401 20 1 1

K < L[20] = 536 1 19 1 0

K = L[19] = 434 Key is Found

Algorithm for Fibonacci Search

Search < t p q r Remarks

key K K=L[p]

>

66 13 8 5 n=20

m=0

K > L[13] = 221 8 8 5 3

K > L[8] = 55 11 2 1

K < L[11] = 94 2 10 1 1

K < L[10] = 84 1 9 1 0

K < L[9] = 81 Since (r=0) p is set to 0

Key is not found

Fibonacci Search

An advantage of fibonacci search over binary

search is that while binary search involves

division which is computationally expensive,

during the selection of next element for key

comparison, fibonacci search involves only

addition and subtraction

- AssetManagement Manual 20130206Uploaded bySaif Eldin
- StackUploaded byaksh
- 40review(JTableJTree)Uploaded byAbdelhamid El El Mejdoubi
- FSP-PaperUploaded byYutyu Yuiyui
- Pipe-Routing Algorithm_Case study.pdfUploaded bymechanical_engineer11
- Computer Notes - Data Structures - 29Uploaded byecomputernotes
- AVL-TreesUploaded byChamu yenigalla
- hw2solUploaded byDesvina Yulisda
- Trees1x1Uploaded byshwetashetty1990
- DME_Payment Config DocumentUploaded byvenu
- Data StructureUploaded bygspriyadarshini
- Union FindUploaded byVikas Thada
- cs344-lect2-3-Astar-2012-1-3-5Uploaded byashu345
- iyuitntUploaded byKatraj Nawaz
- drm_userUploaded byvkm
- RapidMiner 5.2 Advanced Charts English v1.0Uploaded byjuardo
- Applying-R-Trees-In-Non-Spatial-Multidimensional-Databases-.pdfUploaded byijteee
- 75311712-MC0080-SMU-2011Uploaded bychangareddy701
- Practice Final CS61cUploaded byEdward Yixin Guo
- Play With Trees SolutionUploaded byDanh Nguyen
- New Approach Golden RatioUploaded byAnonymous lsnDTjv
- Fast Data Collection in Tree-Based Wireless Sensor NetworksUploaded byHarish Kumar M
- DS-Unit-III NewUploaded byMathiazhagan Arumugam
- Decision Tree AnalysisUploaded bysavvy_as_98-1
- 20251 Program SolutionsUploaded byashwani
- Supertree Example_3.pdfUploaded byEdgar Perez Pzye
- Data Structure 2 MarksUploaded byNellai Ragul
- hw2.psUploaded bySoham Panigrahi
- data structuresUploaded byMohammed Jeelan
- 12975_MCQ new set2Uploaded bylakshmi deepika tatukuri

- 3.Shell Sort.pptxUploaded byanand
- 3.Shell Sort.pptxUploaded byanand
- 4.Radix SortUploaded byanand
- 1.OOPS2Uploaded byanand
- Binary Search Tree1Uploaded byanand
- QueueUploaded byanand
- GraphsUploaded byanand
- Binary Search TreeUploaded byanand
- 1.SearchingUploaded byanand
- StackUploaded byanand
- General Register OrganizationUploaded byanand
- Pipe LiningUploaded byanand
- 3.GraphsUploaded byanand
- Processor RegisterUploaded byanand
- Binary Search TreeUploaded byanand
- 550 Midterm Review Winter2003Uploaded byanand
- Motorola Hc08Uploaded byCarlos Henry
- ch12_p2.pdfUploaded byanand
- ch12_p2.pdfUploaded byanand
- 3.GraphsUploaded byanand

- Computer Based Education and TrainingUploaded byrupika_borntowin2
- Method and system for dynamically processing ambiguous, reduced text search queries and highlighting results thereof (US patent 7779011)Uploaded byPriorSmart
- MÃ©thode et outils d'audit informatiqueUploaded bybl2010
- S2 1405 Schooler PresentationUploaded byAttila Fehér
- Clasen Sample Usability TestUploaded byabhinv1
- Resume SasiPDFUploaded bysasisrinivas
- Cuaderno de Instalaciones Sanitarias - Ing. Huari (UNI)Uploaded byIan Dnvn Vrtdl
- protpostUploaded bydheernik7622
- Nazrin Cv 121813-UpdatedUploaded byAndres Shaon
- Intelligence in the Era of Big Data 4th International Conference on Soft Computing Intelligent Systems and Information Technology ICSIIT 2015Uploaded byJuan Perez
- MELJUN CORTES JEDI Course Notes-Intro1-Lesson05-Getting Input From KeyboardUploaded byMELJUN CORTES, MBA,MPA
- SQA AssignmentUploaded byAngel Choco
- VPNs - Presentation.pdfUploaded byDominik Herkel
- Promass 83 Flowmeter via EtherNetIP to the PlantPAx Process Automation SystemUploaded byJilani Hayder
- Wd Jumper Setting 2579 001037Uploaded byTarak Bhardwaj
- DriveRack PA2 Manual 5044138-A OriginalUploaded byAndro Sviličić
- Essbase-Features Across VersionsUploaded byak56241
- Automated Grading System of Anastrophe Christian School Chapter IIUploaded byJanus Cesar Ruizan Quilenderino
- Spider Project Risk Simulation and Management TechniqueUploaded byBogdanloe
- ReadmeUploaded byJorge Corella
- SunflowerUploaded byErika Pálfy
- Smart Motorola Droid Mini UgUploaded byhockeyman1584
- InteriCADT5 User ManualUploaded byJacob Freeman
- Multiversion Concurrency ControlUploaded byGianni Carlo
- [X] Selection Guide - PowerFlex Low Voltage Drives - PFLEX-SG002K-En-P - February 2017Uploaded byNicolás A. Selvaggio
- Stm32f4discUploaded byHieu Pham
- Trim-cfd Marseille 24mai2012Uploaded byManoj Kumar
- Ladder Logic for PIC and AVRUploaded byTomás Totaro
- CATIA V5 FEA Tutorials Release 20Uploaded byroandluc
- Gujarati SolutionUploaded byPrachi Priya