## 0-1 BFS (Shortest Path in a Binary Weight Graph)

Given a graph where every edge has weight as either 0 or 1. A source vertex is also given in the graph. Find the shortest… Read More »

- Detect Cycle in a Directed Graph using BFS
- Minimum steps to reach any of the boundary edges of a matrix | Set-2
- Islands in a graph using BFS
- 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
- Print the lexicographically smallest BFS of the graph starting from 1
- Iterative approach to check for children sum property in a Binary Tree
- Minimum number of pairs required to make two strings same
- Minimum steps required to reach the end of a matrix | Set 2
- Minimize the number of steps required to reach the end of the array | Set 2
- Difference Between BFS and DFS

Given a graph where every edge has weight as either 0 or 1. A source vertex is also given in the graph. Find the shortest… Read More »

How would you design the data structures for a very large social network like Facebook or Linkedln? Describe how you would design an algorithm to… Read More »

I want to share my interview experience with paytm with all of you. Round-1 [1.5 hr] 1. Brief introduction 2. Discussion about project 3. why… Read More »

Consider a matrix with rows and columns, where each cell contains either a ‘0’ or a ‘1’ and any cell containing a 1 is called… Read More »

Given an undirected tree, we need to find the longest path of this tree where a path is defined as a sequence of nodes. Example:… Read More »

Given a positive number N, we need to reach to 1 in minimum number of steps where a step is defined as converting N to… Read More »

Given a N X N matrix (M) filled with 1 , 0 , 2 , 3 . Find the minimum numbers of moves needed to… Read More »

Problem Statement : Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink… Read More »

Given N X N matrix filled with 1 , 0 , 2 , 3 . Find whether there is a path possible from source to… Read More »

Given a limit N, we need to find out the count of binary digit numbers which are smaller than N. Binary digit numbers are those… Read More »

Given a binary matrix of N x M, containing at least a value 1. The task is to find the distance of nearest 1 in… Read More »

Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out… Read More »

Given a dictionary, a method to do lookup in dictionary and a M x N board where every cell has one character. Find all possible… Read More »

Given a initial number x and two operations which are given below: Multiply number by 2. Subtract 1 from the number. The task is to… Read More »

Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print… Read More »