Problem Statement: Given a grid of size NxM (N is the number of rows and M is the number of

Continue reading# Category: Graph

## Depth First Search (DFS)

Problem Statement: Given an undirected graph, return a vector of all nodes by traversing the graph using depth-first search (DFS).

Continue reading## Breadth First Search (BFS): Level Order Traversal

Problem Statement: Given an undirected graph, return a vector of all nodes by traversing the graph using breadth-first search (BFS).

Continue reading## Connected Components in Graphs

So far we’ve seen different types of graphs. Graphs can be connected or can be like a binary tree (as

Continue reading## Graph Representation in C++

In this article, we are going to study the different ways of representing a graph in memory, but before that

Continue reading## Introduction to Graph

What is a graph data structure? There are two types of data structures Linear Non – linear We are aware

Continue reading## Topological Sort Using DFS

Problem Statement: Given a DAG( Directed Acyclic Graph ), print all the vertex of the graph in a topologically sorted

Continue reading## Dijkstra’s Algorithm – Shortest distance

Problem Statement: Given a weighted, undirected, and connected graph of V vertices and E edges, Find the shortest distance of all

Continue reading## Bellman-Ford Algorithm – Shortest Distance with Negative Edge

Problem Statement: Given a weighted directed graph with negative edge weights with n nodes and m edges. Nodes are labeled from

Continue reading## Minimum Spanning Tree – MST using Prim’s Algo

Problem Statement: Given a weighted, undirected, and connected graph of V vertices and E edges. The task is to find the

Continue reading