Data Structures & AlgorithmsVery hardGATE CS · ICPC regional
Undirected weighted graph on vertices A, B, C, D, E with edges A–B (1), A–C (3), A–E (1), B–C (2), B–D (3), C–E (3), D–E (3). An edge is CRITICAL if it appears in every minimum spanning tree. How many critical edges does this graph have?
- A. 5
- B. 3
- C. 4
- D. 2
Correct answer: B. 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
- A binary trie of 6-bit numbers stores the set S = [35, 33, 47, 2, 38, 26, 51]. For the query x = 20, what is the maximum value of x XOR s…
- Weighted tree on vertices 0 to 5 with edges 0–1 (4), 0–2 (9), 0–3 (9), 2–4 (6), 0–5 (4). What is the largest possible sum of edge weights…
- Words ['ad', 'dd', 'cbd', 'ba', 'cab'] (each may be used at most once). A chain is a sequence of these words in which the first letter of…
- A binary trie of 6-bit numbers stores the set S = [39, 63, 46, 44, 8]. For the query x = 29, what is the maximum value of x XOR s over all…
- Complete undirected graph on vertices A to E with symmetric edge weights given row by row (row i, column j = weight of edge between…
- Consider the recursive function def f(n): if n < 3: return 1; return f(n-1) + f(n-3). Evaluate f(12) and count every invocation of f…