GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A directed graph has edges s→a, s→b, s→c, s→d, a→m, b→m, c→m, m→p, m→q, m→r, p→t, q→t, r→t, d→t. Let E be the maximum number of edge-disjoint s–t paths and V the maximum number of s–t paths that share no vertex other than s and t. What is (E, V)?
- A. (4, 4)
- B. (3, 2)
- C. (4, 2)
- D. (2, 2)
Correct answer: C. (4, 2)
Edge-disjoint: s–a–m–p–t, s–b–m–q–t, s–c–m–r–t and s–d–t use distinct edges (m has 3 in- and 3 out-edges), and s has only 4 out-edges, so E = 4. Vertex-disjoint: every path goes through m or uses s–d–t, so {m, d} is a vertex cut and V = 2 (Menger).
More Algorithms questions
- Men m0–m3 and women w0–w3 have the preference lists (best first) m0: w2 w0 w1 w3; m1: w0 w1 w3 w2; m2: w1 w2 w0 w3; m3: w2 w3 w1 w0; w0…
- Union by rank without path compression is performed (ties: the root of the second argument is attached below the root of the first) on…
- Graham scan or Andrew's monotone chain is used on the points (0,0), (4,1), (2,2), (6,3), (3,5), (8,6), (5,7), (1,8), (7,3), (4,4), (2,6)…
- A Fenwick tree (binary indexed tree) over positions 1–100 performs update(i) by visiting i, then i + (i & −i), and so on while the index…
- The Z-array of a string s has Z[i] = length of the longest common prefix of s and s[i..]. (Z[0] is taken as 0.) What is the sum of all Z…
- What is the length of the longest palindromic substring (contiguous) of xabcbaxyzzyxabcdcbay?