Stack Implementation using Array Program

A stack is a fundamental data structure that follows the Last In, First Out (LIFO) principle, meaning the last element added to the stack will be the first one to be removed. It’s like a stack of plates, you add to the top and take from the top. This post will explore how to implement … Read more

Implement Stack using Singly linked list

Stack can be implemented by both array and linked list. There is some limitation or you can say that drawback in stack implementation using an array is that the array must be declared with some fixed size. In case if the size of the array becomes small to perform the required operation so this is … Read more

Dijkstra’s Algorithm Explanation with example

Dijkstra’s algorithm, given by a brilliant Dutch computer scientist and software engineer Dr. Edsger Dijkstra in 1959. Dijkstra’s algorithm is a greedy algorithm that solves the single-source shortest path problem for a directed and undirected graph that has non-negative edge weight. For Graph G = (V, E)w (u, v) ≥ 0 for each edge (u, … Read more

Kruskal’s Algorithm: Explanation, Example And Program

Kruskal’s Algorithm follows the Greedy Algorithm to construct a Minimum Spanning Tree for a connected, weighted, and undirected graph. This algorithm treats the graph as a forest and its vertices as an individual tree. The aim of this algorithm is to find a subset of the edges that forms a tree that includes every vertex … Read more

Prim’s Algorithm Explanation with Example

Prim’s algorithm uses the greedy approach to find a minimum cost spanning tree for a connected weighted undirected graph. The algorithm builds a tree that includes all vertex and a subset of the edges in such a way that the sum of all the edges weight in the tree is minimum. The major approach for … Read more

Difference between BFS and DFS Graph Traversal

Depth First Search (DFS) Depth First Search (DFS) algorithm traverses a graph in a depthward motion and uses a stack data structure to remember to get the next vertex to start a search when a dead end occurs in any iteration. Breadth First Search (BFS) Difference between BFS and DFS Breadth-First Search (BFS) Depth First … Read more

Hi, Welcome back!
Forgot Password?
Don't have an account?  Register Now