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)
Name | Best | Average | Worst | Memory | Stable | Comments |
---|---|---|---|---|---|---|
Jump search | 1 | √n | √n | 1 | Yes | For sorted arrays |