Data Structures & AlgorithmsVery hardCodeforces Div 2 · ICPC regional
Undirected weighted graph on vertices A, B, C, D, E with edges A–B (2), A–C (1), A–E (3), B–E (2), C–D (1), C–E (3), D–E (2). An edge is CRITICAL if it appears in every minimum spanning tree. How many critical edges does this graph have?
- A. 5
- B. 2
- C. 4
- D. 3
Correct answer: B. 2
There are 3 minimum spanning trees; the edges common to all of them number 2. 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
- Words ['bbb', 'b', 'aab', 'baa', 'baa', 'cc'] are inserted in this order into an empty trie with one node per character, shared prefixes…
- Consider the recursive function def f(n): if n < 3: return 1; return f(n-1) + f(n-3). Evaluate f(10) and count every invocation of f…
- Directed weighted graph on vertices A, B, C, D, E, F with edges listed in this exact order: E→D (7); B→E (-2); C→A (4); D→B (-3); A→B (3)…
- Array A = [3, 2, 4, 10, 10, 2]. Over all non-empty contiguous subarrays, what is the maximum value of the XOR of the elements in the…
- Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–B (1), A–D (1), A–F (1), B–C (1), B–D (1), B–F (1), C–E (1), D–E (1)…
- Keys are inserted in the order 48 55 26 32 38 into an empty binary search tree. Then the key 48 (which has two children) is deleted by…