Implicit graph doubt

i don’t understand the concept of implicit graph explained in the video .

how is it used to find the number of connected components in the graph?

is connected components defined for only undirected graphs?if not,how to find connected components in an undirected graph.please explain with an example.

also give an example of implicit graph for both directed and undirected graphs and how we have found out connected components in then using the implicit graph

@Rj.25 hey ,the implicit graphs are given input in form of 2d array ,take ex of this question:
suppose given matrix of 0 1 and 1 reprseent island,
Input : mat[][] = {{1, 1, 0, 0, 0},
{0, 1, 0, 0, 1},
{1, 0, 0, 1, 1},
{0, 0, 0, 0, 0},
{1, 0, 1, 0, 1}
Output : 5
In this question take all adjacent 1s as 1 island similiarly total island will be 5,
The problem can be easily solved by applying DFS() on each component. In each DFS() call, a component or a sub-graph is visited. We will call DFS on the next un-visited component. The number of calls to DFS() gives the number of connected components. BFS can also be used.
Here is link of code how can you apply:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.