Count the number of islands

Given a binary 2D matrix, containing the combination of 1's and 0's, where 0's represents the water and 1's represent the land. Our task is to find the count of the total number of connected islands. An island is...

Count all possible paths between two vertices of a directed graph

Given a directed graph G, and two vertices: start s & end e, count all possible way of reaching the vertex e from vertex s. Note, these paths don't contain cycle as the existence of the cycle would lead...

Detect Cycle in a Directed Graph

We are given a directed graph with V vertices and we have to find whether this directed graph contains a cycle or not. A cycle in a graph is a non-empty trail in which the first and last vertices are...

Subscribe to our weekly newsletter

Join our community of 1000+ developers and stay updated with the fast moving world of computer science

We promsie, we won't spam
Even we hate spam as much as you hate them