1 / 4

Interpolation search:

Interpolation search:. Interpolation search parallels how humans search through a telephone book. Instead of comparing against every item like the linear search , it attempts to find the item by approximating how far the item is likely to be from the current position. Algo.

boaz
Download Presentation

Interpolation search:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interpolation search: Interpolation search parallels how humans search through a telephone book. Instead of comparing against every item like the linear search, it attempts to find the item by approximating how far the item is likely to be from the current position

  2. Algo Function location(low,high) if low<=high mid =low+(((x-s[low](high-low))/s(high)-s(low)) if x=s[mid] return mid else if x<s[mid] location=location(low,mid-1) else location=location(mid+1,high)

  3. Complexity of Algo For Average case: Average case: lg(lg(n)) For Worst case: worst Case: O(n)

More Related