Data Structures & AlgorithmsHardGATE CS · ICPC regional
Connected undirected graph on vertices A, B, C, D, E, F, G, H with edges A–E (1), B–D (1), B–E (1), C–H (1), D–G (1), D–H (1), E–F (1), G–H (1) (weights ignored). How many bridges does it have? A bridge is an edge whose removal disconnects the graph.
- A. 1
- B. 3
- C. 4
- D. 5
Correct answer: D. 5
Removing each edge in turn and testing connectivity gives 5 bridges. Articulation points or the cyclomatic number are different structural counts that a student may mix up.
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
- Array [12, 23, 8, 18, 15, 14, 26, 13] is turned into a min-heap in place with bottom-up heapify: for i from ⌊n/2⌋−1 down to 0, sift the…
- Coins of denominations [11, 9, 8, 3] are available in unlimited quantity. What is the minimum number of coins needed to pay exactly 28?…
- Distinct words ['caab', 'ac', 'aa', 'c', 'baab', 'bbb', 'bbca'] are inserted into an empty trie (one node per character, shared prefixes…
- On an 6 × 6 chessboard with rows and columns numbered 0 to 5, a knight starts at (2, 5) and must reach (0, 0) (as (row, column)). A knight…
- Complete undirected graph on vertices A to F with symmetric edge weights given row by row (row i, column j = weight of edge between…
- Bipartite graph with left side {A, B, C, D}, right side {E, F, G, H} and edges A–E, B–E, B–H, C–E, C–F, C–G, C–H, D–E. What is the size of…