Challenge 7: Check if an Undirected Graph is Tree or Not
In this lesson, you will learn the difference between a graph and a tree. You will use this knowledge for the challenge below.
Problem statement
The next section will tackle the tree data structure. For now, here’s the basic difference between a graph and a tree. A graph can only be a tree under two conditions:
- There are no cycles.
- The graph is connected.
Access this course and 1400+ top-rated courses and projects.