Data Structures & AlgorithmsVery hardGATE CS · ICPC regional
Undirected weighted graph on vertices A, B, C, D, E with edges A–D (1), B–D (2), B–E (1), C–D (1), C–E (2), D–E (3). An edge is CRITICAL if it appears in every minimum spanning tree. How many critical edges does this graph have?
- A. 3
- B. 5
- C. 4
- D. 2
Correct answer: A. 3
There are 2 minimum spanning trees; the edges common to all of them number 3. Counting edges that appear in some tree is a different quantity.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- Strings a = "accabb" and b = "aaab". The edit distance allows insert, delete and substitute, each costing 1 (the standard Levenshtein…
- Undirected graph on vertices A, B, C, D, E, F with edges A–B (1), A–E (1), B–C (1), B–D (1), B–E (1), B–F (1), C–D (1), D–E (1) (weights…
- Undirected weighted graph on vertices A, B, C, D, E with edges A–B (7), A–C (1), A–D (5), A–E (9), B–D (4), B–E (4), C–D (7), C–E (2), D–E…
- On an 6 × 6 chessboard with rows and columns numbered 0 to 5, a knight starts at (4, 4) and must reach (2, 0) (as (row, column)). A knight…
- Connected undirected graph on vertices A, B, C, D, E, F, G, H with edges A–C (1), B–G (1), B–H (1), C–D (1), C–F (1), C–H (1), D–E (1)…
- Directed weighted graph on vertices A, B, C, D with edges (u→v, w): D→A (8); C→B (4); B→A (6); B→D (4); D→B (7). Let d(x, y) be the…