Recent questions tagged algorithms

0 votes
1 answer
1502
Consider a stack is used to evaluate fully parenthesized arithmetic expression from left to right. Each opperand is placed on the stack and operators operate on top two e...
0 votes
2 answers
1503
Consider A be a 2-dimensional array declared as follows: A[15] [15] of integers. Assume each integer take 1B. The array stored in row major order and first element of arr...
1 votes
1 answer
1504
show how to sort n number in the range [0,n^2-1] in O(n)time?
0 votes
1 answer
1506
Consider f (n), g(n) and h(n) be function defined as follows:Which of the following represents correct asymptotic solution for f (n) + [g(n) × h(n)]?A . Omega(n^3)B. ...
0 votes
1 answer
1515
3 votes
1 answer
1516
$f(n)=2n^2+ n log n$$g(n)= \dfrac{n}{logn} + log^2n$ then $f(n)\times g(n)$ is:$n^2logn$$\dfrac{n^3}{logn}$$n^3log^2n$$n^2log^2n$
4 votes
1 answer
1518
1) Kruskal Algorithm2) Prims Algorithm3) Dijkstra Algorithm4) Bellman Ford Algorithm5) Floyd Warshall AlgorithmAmong these which one works for onlyi) Positive edge weight...
0 votes
3 answers
1519
Question 1) The shortest-path tree computed by Dijkstra's algorithm is necessarily an MST?Question2 ) Prim's algorithm works with negative weighted edges?
0 votes
1 answer
1520
What important point we keep in mind while finding the #(number) of spanning tree ?? from the given graph
0 votes
1 answer
1521
Suppose that a graph G has a minimum spanning tree already computed. How quickly can we update the minimum spanning tree if we add a new vertex and incident edges to G?
0 votes
1 answer
1522
How can we distinguish b/w back edge, the forward edge and cross edge in BFS or DFS traversal in Graphs?
0 votes
2 answers
1525
Let G be a connected simple graph with non distinct edge weights. Now, e be the lightest edge in G. So, does this edge e is present in every MST of G?My take - when all e...
0 votes
0 answers
1528
What is the max height of recursion tree of recurrence $c(100,50)$?here, the recursive function is defined as$c(n,k) = c(n-1,k-1) + c(n,k-1)$terminating condition$c(n,n) ...
0 votes
1 answer
1529
Use a recursion tree to give an asymptotically tight solution to the recurrenceT(n) =T(an)+T((1-a)n)+cn, where a is constant in the range 0<a<1 and c>0 is also a constant...
1 votes
1 answer
1530
Please find the time complexity of the following code:-int i,s1;i=1,s1=1; while(s1<=n) { i++; s1+=s1+i; printf("Hope"); }