Data Structures & AlgorithmsHardCodeforces Div 2 · ICPC regional
Connected undirected graph on vertices A, B, C, D, E, F, G with edges A–B (1), A–F (1), B–F (1), B–G (1), C–F (1), D–F (1), E–F (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. 1
- B. 2
- C. 6
- D. 3
Correct answer: A. 1
Deleting each vertex and testing the rest gives 1 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
- Array A = [3, 8, 11, 5, 4, 7, 7]. Over all non-empty contiguous subarrays, what is the maximum value of the XOR of the elements in the…
- Directed weighted graph on vertices B, E, C, F, A (source B, target A) with edges: B→E (2); B→C (6); C→E (-5); E→A (3); C→A (4); B→A (8)…
- Strings a = "acbc" and b = "aabc". The edit distance allows insert, delete and substitute, each costing 1 (the standard Levenshtein…
- Keys [30, 27, 11, 18, 49, 38, 37] are inserted, in this order, into an empty AVL tree using the standard rebalancing (left, right…
- Array [22, 29, 23, 18, 14, 20, 10] is turned into a min-heap in place with bottom-up heapify: for i from ⌊n/2⌋−1 down to 0, sift the…
- Union–find on elements 0 to 7, all starting as singletons, with no path compression. union(x, y): let rx, ry be the roots of x and y; if…