We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 908fd84 commit 2464b15Copy full SHA for 2464b15
src/main/java/com/thealgorithms/tree/GraphTreeCheck.java
@@ -2,6 +2,16 @@
2
3
import java.util.Scanner;
4
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
15
class GraphTreeCheck {
16
17
private static final int MAX = 10;
0 commit comments