Data Structures & AlgorithmsHardICPC regional · GATE CS top band
Connected undirected graph on vertices A, B, C, D, E, F, G, H with edges A–C (1), B–G (1), B–H (1), C–D (1), C–F (1), C–H (1), D–E (1), F–G (1) (weights ignored). How many articulation points (cut vertices) does it have? A cut vertex is one whose removal, with its incident edges, leaves the remaining vertices disconnected.
- A. 2
- B. 6
- C. 3
- D. 1
Correct answer: A. 2
Deleting each vertex and testing the rest gives 2 cut vertices. Bridges are a different count (the edge version) and degree heuristics are not sufficient.
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
- Directed weighted graph on vertices A, B, C, D with edges (u→v, w): D→A (8); C→B (4); B→A (6); B→D (4); D→B (7). Let d(x, y) be the…
- Array [7, 21, 6, 3, 10, 17, 8] is turned into a min-heap in place with bottom-up heapify: for i from ⌊n/2⌋−1 down to 0, sift the element…
- Coins of denominations [7, 6, 2] are available in unlimited quantity. What is the minimum number of coins needed to pay exactly 18? (Coins…
- 4 × 4 grid, rows top to bottom ('#' = blocked, '.' = open): .... / ..#. / ..#. / ..... Count the paths from top-left to bottom-right that…
- Words ['bcb', 'c', 'ac', 'abbb', 'c', 'bac', 'bbb'] are inserted in this order into an empty trie with one node per character, shared…
- Array A = [3, 11, 10, 2, 3, 8, 6]. Over all non-empty contiguous subarrays, what is the maximum value of the XOR of the elements in the…