retagged by
398 views

1 Answer

0 votes
0 votes
3. Expected cost : To insert , atmost number of cost = 1+a(1+a(1+a......)))=1+a+a^2+a^3........=1/(1-a)

Refer CLRS.

Related questions

1 votes
1 votes
1 answer
1
2018 asked Nov 23, 2016
560 views
0 votes
0 votes
1 answer
2
sushmita asked Sep 28, 2018
847 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
708 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
797 views
FIND THE TIME COMPLEXITYint i=1,j; for(;i <= n;i + +) { for(j = i; j <= nlogn; j∗= 2) { sum++; } }