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 the impact of signed numbers on the memory?
Why null is not allowed in treemap?
Explain binary searching and Fibinocci search?
What is a queue in data structure?
What is the difference between push and pop?
What is the Difference between sax and dom parser?
what are the applications that use Linked lists?
What is top in stack?
What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?
Can we override compareto method for enumerations?
How are elements stored in hashset?
Why do we use different types of data structures?
What is difference between arraylist and linkedlist?
What is Jagged Arrays?
How do you explain bubble sort?