【費式搜尋法】

  /* 費式搜尋法 說明: 二分搜尋法每次搜尋時,都會將搜尋區間分爲一半,所以其搜尋時間爲O(log(2)n),log(2)表示以2爲底的log值,這邊要介紹的費 氏搜尋,其利用費氏數列作爲間隔來搜尋下一個數,所以區間收斂的速度更快,搜尋時間爲O(logn)。 */ #include <stdio.h> #include <stdlib.h> #include <time.h> #defin
相關文章
相關標籤/搜索