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