Edit page

Jump search

Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The basic idea is to check fewer elements (than linear search) by jumping ahead by fixed steps or skipping some elements in place of searching all elements.

For example, suppose we have an array arr[] of size n and block (to be jumped) size m. Then we search at the indexes arr[0], arr[m], arr[2m]…..arr[km] and so on. Once we find the interval (arr[km] < x < arr[(k+1)m]), we perform a linear search operation from the index km to find the element x. (Source: Geeksforgeeks)

Algorithm Visualization

Complexity

NameBestAverageWorstMemoryStableComments
Jump search1√n√n1YesFor sorted arrays

References

  • Geeksforgeeks
  • Wikipedia
  • YouTube