Data Structures & AlgorithmsVery hardGATE CS · Codeforces Div 2
Undirected weighted graph on vertices A, B, C, D, E with edges A–B (2), A–C (1), A–D (3), A–E (1), B–C (2), B–D (2), C–D (2). An edge is CRITICAL if it appears in every minimum spanning tree. How many critical edges does this graph have?
- A. 2
- B. 6
- C. 5
- D. 4
Correct answer: A. 2
There are 5 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
- Strings a = "baabbc" and b = "accca". The edit distance allows insert, delete and substitute, each costing 1 (the standard Levenshtein…
- Points A(5,7), B(2,4), C(3,8), D(5,0), E(1,1), F(9,8) in the plane. The cost of joining two points is the Manhattan distance |x1−x2| +…
- Directed weighted graph on vertices A, B, C, D, E with edges listed in this exact order: B→C (-3); D→A (-1); D→E (-2); A→E (6); B→A (-2)…
- Distinct words ['ba', 'c', 'b', 'ca', 'bc', 'aac'] are inserted into an empty trie (one node per character, shared prefixes share nodes…
- Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–D (1), B–C (1), B–E (1), C–D (1), C–E (1), D–E (1), D–G (1), E–G (1)…
- Directed acyclic graph on vertices A, B, C, D, E, F, G (edges go from earlier to later letters) with weights A→C (4), A→F (1), B→D (2)…