Skip to content

Commit 2464b15

Browse files
committed
added url
1 parent 908fd84 commit 2464b15

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/thealgorithms/tree/GraphTreeCheck.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
import java.util.Scanner;
44

5+
/**
6+
* Check if an undirected graph is a tree using Depth-First Search (DFS).
7+
* A graph is a tree if it is connected and acyclic.
8+
* This implementation reads an adjacency matrix as input and verifies both conditions.
9+
*
10+
* Wikipedia Reference: https://en.wikipedia.org/wiki/Tree_(graph_theory)
11+
* Author: Aman
12+
*/
13+
14+
515
class GraphTreeCheck {
616

717
private static final int MAX = 10;

0 commit comments

Comments
 (0)