edited by
590 views

1 Answer

0 votes
0 votes

See 

Initialy table is empty so 1st element is inserted with Probebility = $\frac{m}{(m)} = 1$

2nd elemnt witll inserted into two places either just before 1st element and just after first element so choice= $\frac{3}{(m)}$

3rd element will have only one choce i.e. 1st time coliision then 2nd time collision then get its place using liener fashion = 1/m posiblity.

Total = $\frac{3}{(m)(m)}$

edited by

Related questions

1 votes
1 votes
1 answer
1
2018 asked Nov 23, 2016
407 views
plz explain otherwise i ll memorize it..
0 votes
0 votes
1 answer
2
sushmita asked Sep 28, 2018
896 views
Find the complexity of the following code fragment:int i = 1; for(; i <= n logn; i++) { for(i++; i <= n; i++) { printf("1") } }
1 votes
1 votes
2 answers
3
sushmita asked Sep 28, 2018
768 views
Find the complexity of the following function when called with some integer n:void foo(n) { int i,j,k,x=0; for (i=1 ; i <= n ; i++) for (j=1 ; j <= i * i ; j++) for ( k ...
0 votes
0 votes
2 answers
4
sushmita asked Sep 28, 2018
848 views
FIND THE TIME COMPLEXITYint i=1,j; for(;i <= n;i + +) { for(j = i; j <= nlogn; j∗= 2) { sum++; } }