## Islands in a graph using BFS

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

- Detect Cycle in a Directed Graph using BFS
- Minimum steps to reach any of the boundary edges of a matrix | Set-2
- Minimum number of given operations required to make two strings equal
- Find the ordering of tasks from given dependencies
- Edge Coloring of a Graph
- Find whether it is possible to finish all tasks or not from given dependencies
- Minimum distance to the corner of a grid from source
- Print all the levels with odd and even number of nodes in it | Set-2
- Finding the path from one vertex to rest using BFS
- Islands in a graph using BFS
- Print the lexicographically smallest BFS of the graph starting from 1
- Iterative approach to check for children sum property in a Binary Tree

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

Given a binary tree, write a function that returns true if the tree satisfies below property: For every node, data value must be equal to… Read More »

Given a binary grid of order r * c and an initial position. The task is to find the minimum distance from the source to… Read More »

Given a connected graph with N vertices and M edges. The task is to print the lexicographically smallest BFS traversal of the graph starting from… Read More »

Given an adjacency list representation of a directed graph, the task is to find the path from source to every other node in the graph… Read More »

Given an N X M matrix, where ai, j = 1 denotes the cell is not empty, ai, j = 0 denotes the cell is… Read More »

Given an N-ary tree, print all the levels with odd and even number of nodes in it. Examples: For example consider the following tree 1… Read More »

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least… Read More »

There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites, for example to pick… Read More »

There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites tasks, for example to… Read More »

Given two strings A and B, both strings contain characters a and b and are of equal lengths. There is one _ (empty space) in… Read More »

In graph theory, edge coloring of a graph is an assignment of “colors” to the edges of the graph so that no two adjacent edges… Read More »

The entire process consisted of 5 rounds: 1 online coding, 1 debugging, 2 Technical and 1 HR/System Design Round. The minimum criteria for the online… Read More »

Given an undirected graph, how to check if there is a cycle in the graph? For example, the following graph has a cycle 1-0-2-1. Recommended:… Read More »

Given an array of integers and a number K with initial and final values. Your task is to find the minimum number of steps required… Read More »