Recent questions tagged time-complexity

0 votes
1 answer
511
for(i=0;i<n;i++) for(j=0;j<i;j++) for(k=0;k<j;k++) what is the time complexity of above psudo code?explain.
0 votes
1 answer
513
i=n;while(i>0){j=1;while(j<=n){j=2*j;}i=i/2;}
0 votes
1 answer
515
WHAT IS THE TIME COMPLEXITY TO ENQUEUE AN ELEMENT IF THE QUEUE IS IMPLEMENTED AS A CIRCULAR QUEUE AND WE HAVE GOT ONLY ONE POINTER TO FRONT ELEMENT??
1 votes
1 answer
516
1 votes
2 answers
519
If t(n) and s(n) denotes the time and space complexity of an algorithm with input size n element then which one of the following is always true?S(n)=O(t(n)) correct H...
1 votes
1 answer
520
Deleting any random element in heap would take n+logn or n+n?
0 votes
1 answer
522
0 votes
1 answer
524
n sorted subarrays each of size log n. find single sorted array with all elements.find time complexity
1 votes
2 answers
525
time complexity to find the n/2 largest element in max heap ?\it must be nlogn
0 votes
1 answer
529
If you are given a sorted list with n elements in ascending order. Then what will be the Time complexity to build a Min heap from the given array?
0 votes
1 answer
530
0 votes
1 answer
531
C function let n>=m.int gcd(n,m){if(n%m==0) return m;n=n%m;return gcd(m,n);} time complexity
0 votes
2 answers
532
find time complexityf(int n){int i=1;while(i<n){int j=n;while(j>0)j=j/2;i=i*2;}}
0 votes
1 answer
533
Q2.int A(int){if(n<=2) return 1;elsereturn (A(√n)+n);} time complexity
0 votes
2 answers
534
Q.1 int A(int n){if(n==2) return 1;else{for(int j=1;j<=n;j++)printf(" * ");return(A(√n));}} Time complexity
0 votes
0 answers
536
What is the number of comparisons required to extract 45th element of the min heap?
0 votes
0 answers
540