Stack

Easy Adjacency Matrix Representation of Graph

Adjacency Matrix Code Adjacency matrix code using C is a way to represent a graph as a 2D array. The array is of size V x V, where V is the number of vertices in the graph. If there is an edge from vertex i to vertex j, then the entry adj[i][j] is set to …

Easy Adjacency Matrix Representation of Graph Read More »

Easy Level Order Traversal of Binary Tree Code

Level Order Traversal of Binary Tree Code This code is for showing Level Order Traversal of a Binary tree creation using queue. In this code first created node will be treated as root node. After that another function insert() will be called for adding the child nodes. Every time one node created and sent to …

Easy Level Order Traversal of Binary Tree Code Read More »

Easy Binary Tree Creation using Stack code

Binary Tree Creation using Stack code This code is for Binary tree creation using stack. In this code first created node will be treated as root node. After that another function insert() will be called for adding the child nodes. Every time one node created and sent to stack for keeping track of that node. …

Easy Binary Tree Creation using Stack code Read More »