Question 11Asked in UGC NET Computer Science, June 2015 (Paper II & III, Selected Questions)

The average case occurs in the Linear search Algorithm when

  1. AThe item to be searched is in some where middle of the array
  2. BThe item to be searched is not in the array
  3. CThe item to be searched is in the last of the array
  4. DThe item to be searcher is either in the last or not in the array
Show answerHide answer

Correct answer: (A) The item to be searched is in some where middle of the array

Explanation

Linear search runs in at worst linear time and make at most n comparisons, where n is the length of the list. If each element is equally likely to be searched then the linear search has an average case of (n/2) comparisons, but the average case can be affected if the search probability for each element vary.

From UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions)

This is question 11 of UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.