Data Structures & AlgorithmsHardGATE CS · ICPC regional
Connected undirected graph on vertices A, B, C, D, E, F, G, H with edges A–D (1), A–E (1), B–D (1), B–E (1), B–G (1), C–D (1), C–H (1), D–H (1), E–G (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. 4
- B. 2
- C. 6
- D. 1
Correct answer: B. 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
- A binary tree with distinct letters has preorder FBGCHAED and inorder GHACBDEF. What is its postorder traversal (left, right, root)…
- Connected undirected weighted graph on vertices A, B, C, D, E with edges A–B (15), A–C (13), A–D (20), B–D (20), B–E (17), C–D (4), C–E…
- Directed weighted graph on vertices A, B, C, D, E with edges (u→v, w): B→D (1); C→D (7); B→A (4); B→C (1); D→E (7); A→D (7); D→C (3). Let…
- Directed graph on vertices A, B, C, D, E, F with edges D→F, F→B, E→F, D→E, D→B, E→D. How many strongly connected components does it have?…
- Bipartite graph with left side {A, B, C, D}, right side {E, F, G, H} and edges A–E, A–F, A–H, B–G, C–F, C–H, D–E, D–H. What is the size of…
- Array A = [30, 14, 22, 26, 8, 7] (all values below 32). What is the maximum of A[i] XOR A[j] over all index pairs with 0 ≤ i < j < 6?