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