Data Structures & AlgorithmsModerateCodeforces Div 2 D
Directed graph on vertices 0 to 8 with edges: 1→4, 1→3, 2→6, 1→0, 5→4, 8→5, 0→2, 4→5, 4→8, 4→1. What is the number of vertices in the largest strongly connected component?
- A. 8
- B. 3
- C. 1
- D. 4
Correct answer: D. 4
The largest group in which every vertex reaches every other has 4 vertices. The set reachable from 0 (3 vertices) is not an SCC, and the largest weak component (8) ignores direction.
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
- Directed graph on vertices 0 to 7 with edges: 3→0, 2→4, 4→1, 3→1, 7→3, 4→2, 6→7, 4→6, 3→5, 7→2, 6→3. What is the number of vertices in the…
- Directed graph on vertices 0 to 7 with edges: 6→3, 1→2, 5→2, 2→4, 3→6, 6→2, 2→5, 7→5, 4→7, 1→6, 3→1, 4→2, 6→1, 1→0. What is the number of…
- Simple undirected graph on vertices 0 to 6 with edges: 1–4, 3–4, 3–6, 4–5, 1–3, 5–6, 4–6, 0–6, 0–5, 1–6. What is the minimum number of…
- Simple undirected graph on vertices 0 to 6 with edges: 0–4, 1–3, 0–3, 3–5, 3–4, 5–6, 1–6, 1–2, 2–3, 1–5, 2–5. What is the minimum number…
- Simple undirected graph on vertices 0 to 5 with edges: 1–2, 1–4, 3–4, 4–5, 0–3, 1–5, 0–4, 2–4, 0–5. What is the minimum number of edges…
- Simple undirected graph on vertices 0 to 5 with edges: 1–4, 0–1, 2–4, 3–4, 1–3, 3–5, 1–2, 4–5, 0–4, 0–3, 0–5. What is the minimum number…