Recent questions tagged algorithms

1 votes
1 answer
3033
1 votes
1 answer
3035
0 votes
2 answers
3038
now , the question says , worst case time complexity. So, in the worst case , the inner loop condition is not satisfied , so , won't it be O(n2) ?
3 votes
4 answers
3040
2 votes
1 answer
3041
1 votes
1 answer
3045
What is the Best Case run time of Heap Sort ?A. $O(1)$B. $O(n)$C. $O(n \log n)$D. $O(\log n)$
0 votes
1 answer
3049
0 votes
1 answer
3051
what is the stack space required by the given function? gate(n) { if(n!=0) return gate(n-1); else printf("gate2016"); }
0 votes
1 answer
3055
If input is sorted in reverse order , then which sorting algorithm will perform best -A) Insertion SortB) Merge SortC) Heap SortD) Quick Sort
1 votes
0 answers
3057
Given answer is B. I believe that is should be D. Please check
3 votes
2 answers
3058
0 votes
0 answers
3059
I got that Statement 3 can be false in case we have function 1/n, then its square become 1/n^2. But I don't think statement 2 is true either. Please prove whether I'm cor...
0 votes
2 answers
3060