1,518 views
0 votes
0 votes
Average number of comparisons required for successful linear search in table of length N
a.( N+2)/2
b. N(N+1)/2
c. N-1/2
d. None of these

1 Answer

0 votes
0 votes
In best case there is a a possibility that u can complete ur search at a very first element out of N elements. So Number of comparisons required is O(1).

In worst case u might end up ur search at last element in the list of  N elements, so Number of comparisons required is O(N).

So Average Number of comparisons= (O(N) + O(1) )  / 2

                                                                  = (N+1)/2     (C)

Related questions

0 votes
0 votes
0 answers
1
radha gogia asked Jun 17, 2018
1,284 views
Successful Search we assume that the probability of searching or finding an element at each location is same , then if we have n elements so probability is $1/n$...Also w...
5 votes
5 votes
1 answer
2
gshivam63 asked Jun 1, 2016
6,923 views
consider an open address hash table with a total of 10000 slots containing 9800 entries. a) 2b) 3c) 4d) 4.5
0 votes
0 votes
0 answers
4
Sanjay Sharma asked Dec 7, 2017
1,247 views
Average case complexity of sequential search if the element that is searched is not in the lista) ( n+p) /2 b) (np+1)/2 c) n(1-p/...