## Traversing directory in Java using BFS

Given a directory, print all files and folders present in directory tree rooted with given directory. We can iteratively traverse directory in BFS using below… Read More »

- Detect Cycle in a Directed Graph using BFS
- Nutanix Interview Experience (On-Campus 2018)
- 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
- Finding the path from one vertex to rest using BFS
- Print all the levels with odd and even number of nodes in it | Set-2
- Minimum distance to the corner of a grid from source
- Print the lexicographically smallest BFS of the graph starting from 1

Given a directory, print all files and folders present in directory tree rooted with given directory. We can iteratively traverse directory in BFS using below… Read More »

Suppose A is at position (0, 0) of a 2-D grid containing ‘m’ rows and ‘n’ columns. His aim is to reach the bottom right… Read More »

Given a directed graph, a source vertex ‘src’ and a destination vertex ‘dst’, print all paths from given ‘src’ to ‘dst’. Consider the following directed… Read More »

Coding Round: A variation of Knapsack Easy string manipulation problem A brute-force based string matching problem Technical Round 1: Finding the length of a Linked-List… Read More »

You are given a undirected graph G(V, E) with N vertices and M edges. We need to find the minimum number of edges between a… Read More »

Given an undirected tree with some marked nodes and a positive number K. We need to print the count of all such nodes which have… Read More »

Searching a graph is quite famous problem and have a lot of practical use. We have already discussed here how to search for a goal… Read More »

In previous post, BFS only with a particular vertex is performed i.e. it is assumed that all vertices are reachable from the starting vertex. But… Read More »

Prerequisites : BFS, DFS In BFS and DFS, when we are at a node, we can consider any of the adjacent as next node. So… Read More »

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 »