read this https://www.geeksforgeeks.org/strongly-connected-components/
after that check this for practicing https://gateoverflow.in/238313/connected-components
64.3k questions
77.9k answers
244k comments
80.0k users