GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A tree on vertices 0–10 has weighted edges 0-1 (3), 1-2 (4), 1-3 (2), 3-4 (6), 3-5 (1), 5-6 (7), 0-7 (5), 7-8 (2), 2-9 (3), 9-10 (8). Its centre is a vertex minimising the largest weighted distance to any other vertex. Which vertex is the centre, and what is that largest distance (the radius)?
- A. vertex 2, radius 14
- B. vertex 1, radius 15
- C. vertex 3, radius 17
- D. vertex 2, radius 12.5
Correct answer: A. vertex 2, radius 14
The diameter is 25 (from 10 to 6: 8+3+4+2+1+7, or 10 to 8). Eccentricities: vertex 2 → 14 (to 6 and to 8: 4+3+5+2), vertex 1 → 15, vertex 9 → 17, vertex 3 → 17. So the centre is vertex 2 with radius 14. Half the diameter, 12.5, is only a lower bound because the centre must be a vertex.
More Algorithms questions
- Vertices 0–10 of the tree with edges 0-1, 1-2, 1-3, 3-4, 3-5, 5-6, 0-7, 7-8, 2-9, 9-10 carry weights w = 4, 7, 3, 9, 5, 2, 8, 6, 5, 4, 10…
- Five cities have symmetric distances d(0,1) = 9, d(0,2) = 14, d(0,3) = 23, d(0,4) = 17, d(1,2) = 11, d(1,3) = 19, d(1,4) = 26, d(2,3) = 8…
- The standard 2-approximation for Vertex Cover scans the edges in the order 0-1, 1-2, 2-3, 3-4, 4-5, 5-6, 1-4, 2-5 and, whenever an edge…
- Items 0.5, 0.7, 0.5, 0.2, 0.4, 0.2, 0.5, 0.1, 0.6 (in this order) are packed into bins of capacity 1 by Next-Fit, First-Fit and…
- Longest-Processing-Time-first scheduling puts jobs, in non-increasing order of length, on the currently least loaded machine. For jobs of…
- For the string s = abaababaabaab (13 characters), a number p (1 ≤ p ≤ 13) is called a period if s[i] = s[i + p] for every valid i (p = 13…