Category: Data Structures
-
Difference between Graph and Tree
Graph: A graph is a collection of two sets V and E where V is a finite non-empty set of vertices and E is a finite non-empty set of edges. For example: G = {{V1, V2, V3, V4, V5, V6}, {E1, E2, E3, E4, E5, E6, E7}} Trees: A tree is…
-
Graphs
A graph named G can be defined as ordered set G(V,E) where V(G) represents the set of vertices and E(G) represents the set of Edges which are used to connect these vertices. If n is the number of vertices, then total number of edges can be calculated with the formula…
-
Binary Trees
Binary Tree, The word binary itself says it is a base-2 numeral number system. Similarly Tree, It has branches, roots etc. But in the language of programming we call branches of a tree as Nodes. A tree can have ‘n’ number of branches, But Binary Tree is a tree which…