Data Structures & AlgorithmsVery hardProduct-company placement
An undirected connected graph has edges A–D, A–F, A–G, B–C, B–F, B–H, B–I, C–D, C–H, D–F, E–I. How many articulation points (cut vertices) and how many bridges does it have?
- A. 3 articulation points, 3 bridges
- B. 4 articulation points, 3 bridges
- C. 3 articulation points, 4 bridges
- D. 2 articulation points, 3 bridges
Correct answer: A. 3 articulation points, 3 bridges
Cut vertices: A, B, I; bridges: A–G, B–I, E–I. 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
- A min-heap holds 31 distinct keys in a 0-indexed array (a full tree with 5 levels). At how many different indices can the 4th-smallest key…
- In the grid 11111 / 11112 / 11121 / 11111 (rows top to bottom; 2 = rotten, 1 = fresh, 0 = empty), every minute each rotten orange rots its…
- A B-tree has minimum degree t = 3 (every non-root node has between 2 and 5 keys) and height 2 (a root-only tree has height 0). What are…
- In the grid 11111 / 11210 / 21111 / 00111 (rows top to bottom; 2 = rotten, 1 = fresh, 0 = empty), every minute each rotten orange rots its…
- What is the edit distance (insert, delete, substitute; each cost 1) between RECESSION and HEAPSORT?
- Symbols occur with frequencies 3, 4, 13, 27, 35. How many bits does an optimal (Huffman) prefix code need for the whole message, and how…