What is the average number of comparisons in a sequential
search?
Answer Posted / vivek tiwari
f(n)= 1.Pn + 2.Pn + 3.Pn +...+ N.Pn
where
Pn = 1/N
f(n)= 1.1/N +2.1/N + 3.1/N+....+N.1/N
= (1+2+3+....+N)1/N
= N(N+1)/2N
= (N+1)/2
| Is This Answer Correct ? | 47 Yes | 1 No |
Post New Answer View All Answers
Tell me do array subscripts always start with zero?
Which sorting algorithm has minimum number of swaps?
Which sorting is best in time complexity?
What is data structure and its operations?
What are linked lists used for?
Define tree edge?
Define a binary search tree?
What is a subtree?
Why arraylist is not efficient for manipulation?
What is meant by balanced binary tree?
What is difference between hashset and treeset?
What is the difference between list and arraylist?
Is arraylist a collection?
Is arraylist faster than array?
Does arraylist shrink?