Recent questions tagged algorithms

0 votes
3 answers
1472
What is the time complexity of the following code?for(i=n;i>=1;)i=i/2;
0 votes
1 answer
1473
How to solve using recursion tree methodT(n) = T(n/2) + c ; n 1T(n) = C ; n = 1
0 votes
1 answer
1474
Array follows static memory allocation then why it gives garbage value in case of uninitialized array .and it gives zero when the array is partially initialized?
0 votes
1 answer
1475
1 votes
2 answers
1478
What will be the solution of the following recurrence?$$T(n)=3T\sqrt{n}+\log(n)$$
0 votes
3 answers
1479
int main() { int i; for(i=1;i<=n;i++) f(i); } void f(int n) { int A[n]; int j; for(j=1;j<=n;j++) cout<<j; }What will be the time and space complexity of the following cod...
1 votes
2 answers
1480
T(n)=T(n-1)+2n where T(1)=1Solve recurrence relation
0 votes
0 answers
1481
0 votes
1 answer
1482
0 votes
0 answers
1483
#DAAProve that if: f(n) = amnm + am-1nm-1 + am-2nm-2 + am-3nm-3 + .........+ a1n + a0 then f(n) = O(nm) .
1 votes
1 answer
1485
Which sorting algorithm is good if we already knew the range of number -Counting Sort OR Radix Sort
3 votes
2 answers
1486
7 votes
3 answers
1490
Why is recursive equation of following code $T(n)=T(n/2)+O(1)$, not $T(n)=8*T(n/2)+O(1)$? int x=0; int A(n) { if(n==1) return 1; else { X+=8A(n/2)+n^3; } return X; }
0 votes
1 answer
1492
Why do we say Merge sort makes good use of locality of reference? and if I have $1 \hspace{0.1cm} billion$ elements and my memory can only store $1 \hspace{0.1cm} million...
0 votes
1 answer
1499
The minimum and maximum number of keys in the internal nodes of B-r with order 4 is:(a) 1, 3(b) 2, 4(c) 1, 4(d) 2, 3