Data Structures & AlgorithmsVery hardProduct-company placement
An undirected connected graph has edges A–C, B–D, B–F, B–H, C–D, C–F, D–G, D–I, E–H, F–G. How many articulation points (cut vertices) and how many bridges does it have?
- A. 5 articulation points, 4 bridges
- B. 4 articulation points, 5 bridges
- C. 3 articulation points, 4 bridges
- D. 4 articulation points, 4 bridges
Correct answer: D. 4 articulation points, 4 bridges
Cut vertices: B, C, D, H; bridges: A–C, B–H, D–I, E–H. A bridge's endpoints are cut vertices unless they are leaves, and a vertex joining two cycles is a cut vertex even with no bridge.
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
- Coins of denominations 1, 9, 10, 11 are available in unlimited supply. What is the minimum number of coins needed to make 18, and how many…
- A BST holds integer keys between 1 and 100. Which sequence CANNOT be the sequence of keys examined while searching for 46?
- Dijkstra's algorithm runs from A on the directed graph A→B (6), A→E (1), A→F (11), B→C (9), B→D (2), B→F (1), C→D (10), C→F (11), D→A (5)…
- With 3 identical eggs and at most 7 drops, what is the largest number of floors for which you can always determine the critical floor (the…
- 0/1 knapsack with capacity 18: items (weight, value) = (8, 39), (2, 16), (3, 24), (6, 38), (3, 36). What is the maximum total value?
- Six sorted files have 8, 23, 33, 38, 42, 49 records. Merging two files of sizes a and b costs a + b. What is the minimum total cost to…