Problem Statement: Given a Directed Graph with V vertices and E edges, check whether it contains any cycle or not.

Continue reading# Category: Data Structure

## Shortest Path in Undirected Graph with unit distance: G-28

Given an Undirected Graph having unit weight, find the shortest path from the source to all other nodes in this

Continue reading## Topological Sort Algorithm | DFS: G-21

Problem Statement: Given a Directed Acyclic Graph (DAG) with V vertices and E edges, Find any Topological Sorting of that

Continue reading## Kahn’s Algorithm | Topological Sort Algorithm | BFS: G-22

Problem Statement: Given a Directed Acyclic Graph (DAG) with V vertices and E edges, Find any Topological Sorting of that

Continue reading## Shortest Path in Directed Acyclic Graph Topological Sort: G-27

Given a DAG, find the shortest path from the source to all other nodes in this DAG. In this problem

Continue reading## Find Eventual Safe States – DFS: G-20

Problem Statement: A directed graph of V vertices and E edges is given in the form of an adjacency list

Continue reading## Detect cycle in a directed graph (using DFS) : G 19

Problem Statement: Given a directed graph with V vertices and E edges, check whether it contains any cycle or not.

Continue reading## Matrix Chain Multiplication | Tabulation Method | (DP-49)

In the previous article, we learned the solution for the problem of “Matrix chain multiplication”. We had discussed the recursive

Continue reading## Number of Distinct Islands

Problem Statement: Given a boolean 2D matrix grid of size N x M. You have to find the number of

Continue reading## Number of Longest Increasing Subsequences | (DP-47)

Problem Statement: Number of Longest Increasing Subsequences Prerequisite: Longest increasing subsequence, Printing Longest Increasing subsequence Problem Link: Given an array,

Continue reading