Ads

Saturday, 25 February 2017

Data Structure - Searching - Interpolation

Interpolation Search

It is one of the searching technique and it is the fast search algorithm.

-> The runtime complexity is O(log(log n)).
-> It follows divide and conquer principle
-> The elements in the array should be in sorted form and equally distributed.

The searching is similar to binary search but it is little advanced than the binary search.

It search with the formal shown below.

mid = Lo + ((Hi - Lo) / (A[Hi] - A[Lo])) * (X - A(Lo))

where 

A = List
Lo = Lowest index
Hi Highest index
A[n] = the nth element in the Array

No comments:

Post a Comment

SOLID Principles

SOLID principles are the basic essential thing to know for every developer before he/she starts coding in any IDE. Here is the full form S ...