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
Which type of sorting is best?
What is ascii sort order?
Define a stack?
How many null values are allowed in hashmap?
Define separate chaining?
What does a bubble chart show?
How can you implement a stack?
What is data type with example?
Which sorting does collections sort use?
Which data structures are used in bfs and dfs algorithm?
What is the difference between the hash table and hash map?
Does linkedhashset allow null values?
What do you know about traversal in linked lists?
How many types of data structure are there?
Which type of memory allocation is referred for linked list?