Show the worked solutionLinear search compares the key with the elements one by one. If the item is equally likely to be at any of the \(n\) positions, the expected number of comparisons is\[\frac{1+2+\cdots+n}{n}=\frac{n+1}{2},\]which is what happens when the item is around the middle of the array.(B), (C), (D) Item at the end or absent needs \(n\) comparisons — that is the worst case, not the average.Answer: A
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com