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. Vertices are nothing but the nodes in the graph. Two adjacent vertices are joined by edges. Any graph is denoted as…
-
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…