Recent questions tagged algorithms

303
views
1 answers
1 votes
Let $\text{G = (V, E)}$ be a connected, undirected graph with edge weights $w: \text{E} \rightarrow \mathbb{Z}$. Suppose $\text{G}$ has a ... no cycles$\text{G}$ contains at most one cycleAll edge weights are differentNone of the above
326
views
1 answers
3 votes
Let $n$ be a positive integer.Consider the two statements below:$\text{S1:}$ If $f(n)>g(n)$ for all $n$ then $g(n)$ ... is incorrect$\text{S1}$ is incorrect but $\mathrm{S} 2$ is correctBoth are correctBoth are incorrect
342
views
1 answers
2 votes
Which of the following is/are TRUE?In the worst case, merge sort runs in $O\left(n^2\right)$ time.Depth-first search of a graph is asymptotically faster than ... a binary search tree leaves the same tree as inserting $y$ and then $x$.
300
views
1 answers
2 votes
Suppose we have a set of $n$ values. There are always at least one negative value and at least one positive value in the set.What is the worst case time ... known) and arranged in descending order then it takes $\theta(n)$ in worst case.
253
views
1 answers
1 votes
Let $\text{G = (V, E)}$ be a simple undirected graph, and $s$ be a particular vertex in it called the source. For $x \in \text{V},$ let $d(x)$ denote the shortest distance in ... $(u, v)$, we have $d[v]=d[u]+1$
194
views
1 answers
2 votes
Consider the given two statements.$\mathrm{S} 1:$ Depth-first search is asymptotically faster than breadth-first search.$\mathrm{S} 2:$ Deleting an element from a ... $\mathrm{S} 1$ is wrong.Both are correctBoth are False
748
views
3 answers
0 votes
Q )Six jobs are waiting to be run. The expected running times are 9, 7, 5, 2, 1 and x respectively. Where 5 < x < 7 and the average completion time is 13. Find the ... ? (Assume all jobs arrive at same time = 0).a)3.33b)4.33c)5.33d)6.33