• edited by
14,494 views
31 31 votes

Consider the following graph:

Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskal’s algorithm?

  1. $\text{(b, e) (e, f) (a, c) (b, c) (f, g) (c, d)}$

  2. $\text{(b, e) (e, f) (a, c) (f, g) (b, c) (c, d)}$

  3. $\text{(b, e) (a, c) (e, f) (b, c) (f, g) (c, d)}$

  4. $\text{(b, e) (e, f) (b, c) (a, c) (f, g) (c, d)}$

5 Answers

Best answer
37 37 votes

In Option D $\text{ b-c}$ with weight, $4$ is added before $\text{a-c}$ with weight $3$ is added. In Kruskal's algorithm, edges should be added in non-decreasing order of weight.

So, Option D may be correct.

• edited by
Answer:
Position:
Show:

Related questions

57 57 votes
4 answers 4 answers
22.8k
22.8k views
go_editor asked Apr 23, 2016
22,768 views
A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences $X[m]$ and $Y[n]$ of lengths ...
40 40 votes
3 answers 3 answers
13.9k
13.9k views
Kathleen asked Sep 22, 2014
13,886 views
A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences $X[m]$ and $Y[n]$ of lengths ...
74 74 votes
8 answers 8 answers
32.5k
32.5k views
Kathleen asked Sep 22, 2014
32,456 views
In quick-sort, for sorting $n$ elements, the $\left(n/4\right)^{th}$ smallest element is selected as pivot using an $O(n)$ time algorithm. What is the worst case time com...
39 39 votes
5 answers 5 answers
21.0k
21.0k views
Kathleen asked Sep 22, 2014
20,970 views
The running time of an algorithm is represented by the following recurrence relation:$T(n) = \begin{cases} n & n \leq 3 \\ T(\frac{n}{3})+cn & \text{ otherwise } \end{...