Recent questions tagged algorithms

0 votes
0 answers
1921
1. What is the time complexity to design BST from given postorder and inorder traversal?2. What is the time complexity to design BST from given postorder only. I know tim...
4 votes
1 answer
1922
for (i=n ; i>0 ; i ) { for ( j=1;j<n ; j=j*2) { for ( k=0;k<j ;k++) { } } }time complexity ??how to find of inner and innermost loop?
4 votes
1 answer
1923
What will be the Big Oh for $n!$ ?As we can deduce log($n!$) = O(log n) .Is there any proof like we have for log($n!$) ?
2 votes
1 answer
1924
1 votes
2 answers
1926
What will be the time complexity of A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=(i^2);j++) { for(k=1;k<=(n/2);k++) { printf("ABCD"); } } } }
1 votes
1 answer
1927
What will be the time complexity of the following code?A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { for(k=1;k<=100;k++) { printf("ABCD"); } } } }
5 votes
1 answer
1929
1 votes
1 answer
1934
3 votes
0 answers
1935
While going through dijkstra's algorithm, there is a term "decrease key". I am not getting the meaning when it says "we do decrease key operation". What exactly we do and...
2 votes
1 answer
1936
0 votes
0 answers
1937
4 votes
1 answer
1939
True or FalseMerge sort on Linked list takes O(nlogn)
2 votes
1 answer
1940
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority ...
3 votes
1 answer
1941
Solve the following recurrence relation$T(n)=4T(n/2)+n^2 \sqrt 2$
2 votes
2 answers
1942
3 votes
1 answer
1945
3 votes
1 answer
1946
Selection of the kth smallest element in a set of n elements.O(n)O(n^2).Reason.
4 votes
4 answers
1947
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is(A) (n log n) / 2(B) n ...
1 votes
1 answer
1948
If in a given graph all edge weights are equal and negative then BFS will correctly find out single source shortest path to all vertices,starting from vertex v? True/Fals...
1 votes
2 answers
1949
.Let S1= ∑nr/2r (r=0 to logn-1) .S2= ∑r2r (r=0 to logn-1)what will be s1 and and s2 after expension
5 votes
5 answers
1950
Total no. of ways to perform matrix multiplication having 7 matrices is ?Total no. of ways to by which we could parenthesize 7 matrices is ?Does the above two questions ...