Recent questions tagged algorithms

1 votes
1 answer
1891
0 votes
1 answer
1893
can masters theorem be used when base condition is given in a recurrence ?can we directly apply masters theorem to any recurrence ?
2 votes
1 answer
1895
operation on the list in this order O(sqrt n)insert,O(nlog n) decrease key ,O(n) find operations. What is the time complexity of all these operations put together ?
5 votes
2 answers
1897
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?
3 votes
0 answers
1899
First Statement is true. But I don't know about second?
1 votes
0 answers
1900
First statement is False because complexity will be O(E2).I think the second statement is true? But not sure
2 votes
1 answer
1901
Suppose A is sorted array and some of the elements are duplicates what is the best upper bound to find out the number of elements that are equal to any given key 'k'.
5 votes
1 answer
1902
3 votes
1 answer
1904
Number of rooted labeled trees(i.e. each node can be the root) with 6 vertices is:
1 votes
1 answer
1906
Which of the following is true about time complexity for generating $\color{blue} {n^{th}}$ Fibonacci number ? a)$O(n)$b)$O(Logn)$c)$O(2^n)$d)$\Omega(n)$
0 votes
1 answer
1907
5.Consider the Knapsack instance with 5 objects and a capacity M=11, profit P=(5,4,7,2,3) andweight W=(4,3,6,2,2.). Solve it using dynamic programming approach.
1 votes
0 answers
1908
Assuming that the graph can contain repeated edge weights, we have a single tree at any instance when applying Prim's algorithm.Justify this statement.
1 votes
1 answer
1909
which is asymptotically greater n or $2^{logn}$
2 votes
1 answer
1911
Can Anyone provide all the data structure that we can used and time complexity that we get for Kruskal algorithm of finding the minimum spanning tree.
5 votes
0 answers
1913
//n is a prime number hereint main() { for(i=1;i<=n;i=2*i) { for(j=1;j<=n;j++) { if(n%i==0) { k=1; while(k<=n) { a=b+c; k=k+1; } } } } }
0 votes
0 answers
1914
1 votes
0 answers
1915
True or False ExplainBellman Ford can never find shortest path of a graphFloyd Warshall can find shortest path of a graph
0 votes
0 answers
1916
What is the disadvantage of avl tree over b tree ??
0 votes
0 answers
1918
Most efficient data structure to implement Sets of Integer and what is the complexity of operationinsert(int e),delete(int e),isMember(int e) : returns TRUE if member oth...
0 votes
0 answers
1920
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...