Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to find the strongly connected components in a directed graph using Tarjan's algorithm.

Hard

Problem Statement

Write a program to find the strongly connected components in a directed graph using Tarjan's algorithm.

Sample Input

Graph: Provided in the problem description.

Sample Output

Strongly Connected Components:
2 1 0
5 4 3

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; class StronglyConnectedComponents { static void Main() { // Find strongly connected components in a directed graph } }
Log in or sign up to run or submit your code.Log inSign up
Input
Graph: Provided in the problem description.
Expected Output
Strongly Connected Components:
2 1 0
5 4 3