GATE Computer ScienceVery hardGATE CS
An undirected graph has vertices 0 to 13 and edges 0-1, 1-2, 2-0, 2-3, 3-4, 4-5, 5-3, 5-6, 6-7, 7-8, 8-6, 1-9, 9-10, 10-11, 11-9, 4-12, 12-13. Let A be the number of articulation points and B the number of bridges. What is A + B?
- A. 12
- B. 11
- C. 14
- D. 13
Correct answer: D. 13
The triangles are {0,1,2}, {3,4,5}, {6,7,8} and {9,10,11}. Articulation points are 1, 2, 3, 4, 5, 6, 9 and 12 (A = 8); bridges are 2-3, 5-6, 1-9, 4-12 and 12-13 (B = 5), so A + B = 13. Vertex 12 is an articulation point because removing it detaches 13.
More Algorithms questions
- In how many different ways can the 10 distinct keys 1, 2, ..., 10 be arranged in the array positions 1 to 10 of a binary max-heap (each…
- How many binary search trees on the 7 keys 1 to 7 have height exactly 4 (height counted in edges, a single node has height 0)?
- How many times is x++ executed by the following code? for (i = 1; i <= 100; i++) for (j = 1; j <= 100; j += i) x++;
- The array [7, 3, 11, 1, 9, 12, 5, 2, 10, 4, 8, 6] is sorted by merge sort. How many inversions (pairs i < j with a[i] > a[j]) does it…
- A connected weighted undirected graph has vertices 0 to 5 and edges (u, v, weight): (0,1,2), (0,2,2), (1,2,2), (1,3,3), (2,3,3), (2,4,3)…
- A tree has vertices 0 to 9 with edges 0-1, 0-2, 1-3, 1-4, 2-5, 2-6, 4-7, 4-8, 6-9, and vertex weights w0 = 5, w1 = 4, w2 = 6, w3 = 3, w4 =…