Open In App

GATE | GATE MOCK 2017 | Question 23

Like Article
Like
Save Article
Save
Share
Report issue
Report

The increasing order of performance  of the searching algorithms are:

(A)

linear search  <  jump search  <  binary search

(B)

linear search  >  jump search  <  binary search

(C)

linear search  <  jump search  >  binary search

(D)

linear search  >  jump search  >  binary search



Answer: (A)

Explanation:

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 a block (to be jumped) of size m. Then we search in 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.

Performance in comparison to linear and binary search:

If we compare it with linear and binary search then it comes out then it is better than linear search but not better than binary search. The increasing order of performance is:

linear search  <  jump search  <  binary search

Hence Option(A) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 10 Jun, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads