[課業] 國考課業相關問題,非歷屆考題的討論,如學理觀念的釐清。
遇到一個問題如下:但我求出的2是4不知為何答案為5
work through fibonacci search on an ordered file with
keys (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)and determine
the number of key comparisons made while searching for the
keys 2,10 and 15
(for fibonacci search we need three fibonacci number f(5)=5
,f(6)=8,f(7)=13)
尋求大大解惑
我也是算4次,一開始樹的高度是5,root值=8, 8>2所以樹不用調整(13~16),所以依次搜尋8,5,3,2 共4次我參考答案也是5次 ,不知道觀念哪裡出錯 XD