difference between a graph and a tree?

By vivek kumar in 22 Jul 2024 | 01:20 pm
vivek kumar

vivek kumar

Student
Posts: 552
Member since: 20 Jul 2024

 difference between a graph and a tree?

22 Jul 2024 | 01:20 pm
0 Likes
Prince

Prince

Student
Posts: 557
Member since: 20 Jul 2024

Graph:

  1. Cycles: May contain cycles (paths where the start and end nodes are the same).
  2. Connectivity: Can be connected or disconnected.
  3. Edges: Number of edges can exceed V1V-1 (where VV is the number of vertices).
  4. Root: Does not have a designated root node.
  5. Traversal: Traversal can be complex with multiple paths and cycles (e.g., BFS, DFS).

Tree:

  1. Cycles: Always acyclic (no cycles).
  2. Connectivity: Always connected (there is a path between any pair of nodes).
  3. Edges: Always has exactly V1V-1 edges.
  4. Root: Has a single root node from which all other nodes are reachable.
  5. Traversal: Traversal is simpler and often involves methods like pre-order, in-order, and post-order
22 Jul 2024 | 06:19 pm
0 Likes

Report

Please describe about the report short and clearly.