Algorithm: DFS (Matrix)