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
What is hash value of a string?
How many sorting algorithms are there?
What is a spanning tree?does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
What is difference between hashmap and hashset?
Explain how to find 3rd element from end in a linked list in one pass?
What do you mean by the term “percolate up”?
What is the difference between array and list?
Can arraylist have duplicates?
What's the difference between an array and vector?
What is the need for extendible hashing?
What data structure underlies a python list?
What is integer max_value?
What is Jagged Arrays?
What do you mean by garbage collection?
What is array simple?