Recent questions tagged algorithms

0 votes
1 answer
122
1 votes
1 answer
124
consider the following message BCCABBDDAECCBBAEDDCC find the no of bits requiered for huffman encoding of above message
0 votes
1 answer
125
Consider the following function:function X(n,r) { if(r==0 or n == r) then return 1; else return (X(n-1,r-1,) + X(n-1,r)); }Find the worst case time complexity of function...
0 votes
1 answer
128
1 votes
1 answer
129
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
0 votes
0 answers
130
0 votes
0 answers
131
0 votes
0 answers
132
0 votes
0 answers
133
0 votes
1 answer
135
int fun1( int n ){ int i , j , p =0, q =0; for( i =1 ; i < n ; ++i) { for( j =n ; j 1; j = j/2) ++p; for( k =n ; k p; k ...
0 votes
1 answer
136
Answer ????
0 votes
0 answers
138
0 votes
1 answer
139
How many times is the comparison $i >= n$ performed in the following program?int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
0 votes
1 answer
142