作者Rakoto (我的未來不是夢)
看板TransCSI
標題[問題]請教各位大大~~~
時間Fri Jun 24 11:08:04 2005
請教一下大家~~
題目如下:
Let A[n] be an array with n element sorted in asccnding order.
It is simple to construct an O(log n) algorithm to find the position k
in A[n] for a given value v.
Assume that k is much less than n (i.e. k<<n)
Write an O(log k) time algorithm to search for v.
(Note:You do not know the value of k in advance, only v is known.)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.131.230.94
推 hicoy:binary search?140.121.213.170 06/24
推 deepdish:的確蠻像二元搜尋法 140.115.201.20 06/24