Data Structures & AlgorithmsModerateICPC regional · Codeforces Div 2 E
Directed graph on vertices 0 to 5 with edges: 5→4, 2→3, 4→3, 3→1, 1→0, 2→5, 4→1, 4→2, 0→1. How many strongly connected components does it have (maximal sets in which every vertex can reach every other)?
- A. 1
- B. 0
- C. 2
- D. 3
Correct answer: D. 3
Vertices that can reach each other form one component, giving 3 groups in total. Ignoring edge directions gives only 1 weakly connected pieces, which is the usual slip.
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 6 with edges: 1→0, 4→2, 6→0, 3→0, 5→3, 5→0, 0→5, 1→4, 2→3. How many strongly connected components does it…
- Directed graph on vertices 0 to 5 with edges: 4→0, 0→3, 4→2, 5→1, 2→0, 5→2, 1→2, 3→2, 3→0. How many strongly connected components does it…
- Directed graph on vertices 0 to 6 with edges: 5→3, 4→3, 3→6, 5→6, 5→2, 2→1, 3→4, 1→0, 2→0, 1→5, 0→2, 0→5. How many strongly connected…
- Directed graph on vertices 0 to 6 with edges: 5→4, 4→3, 2→4, 3→2, 2→5, 4→2, 2→1. How many strongly connected components does it have…
- Directed graph on vertices 0 to 6 with edges: 0→4, 4→2, 5→1, 1→6, 4→5, 5→2, 0→2, 6→3, 0→5, 6→0. How many strongly connected components…
- Directed graph on vertices 0 to 7 with edges: 1→4, 5→7, 1→5, 4→3, 0→1, 6→7, 3→5, 7→1. How many strongly connected components does it have…