Data Structures & AlgorithmsVery hardCodeforces Div 2 · ICPC regional
Undirected weighted graph on vertices A, B, C, D, E with edges A–B (2), A–D (2), A–E (1), B–D (3), B–E (2), C–E (1). 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. 2
- D. 4
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
- Distinct words ['aac', 'cb', 'ba', 'bc', 'a'] are inserted into an empty trie (one node per character, shared prefixes share nodes, and a…
- Undirected weighted graph on vertices A, B, C, D, E, F; its edges, in this listed order, are: C–F (2), B–D (2), D–E (7), B–C (9), D–F (2)…
- Directed weighted graph on vertices A, B, C, D, E with edges (u→v, w): C→A (8); D→E (2); B→A (9); E→D (1); B→D (1); A→E (1); E→A (9); A→B…
- Undirected weighted graph on vertices A, B, C, D, E, F with edges A–B (1), A–C (3), B–C (7), B–D (5), B–E (7), B–F (7), C–F (2), D–E (1)…
- Undirected graph on vertices A, B, C, D, E, F, G with weighted edges A–C (7), A–D (7), B–C (4), B–F (9), B–G (5), C–F (5), D–F (1), E–F…
- Keys are inserted in the order 12 31 77 11 65 57 into an empty binary search tree. Then the key 12 (which has two children) is deleted by…