A number is called as a Jumping Number if all adjacent digits in it differ by 1. The difference between ‘9’ and ‘0’ is not… Read More

# Tag Archives: DFS

Intuit came to our college campus for placements. Shortlisted 13 students after written and then selected 4 students for Full Time Job. There were 3… Read More

Recently makemytrip visited our Campus and I got selected in recruitment drive.The placement drive consisted of 4 rounds. Round1: MCQ and coding round It was… Read More

Given a list of contacts containing the username, email and phone number in any order. Identify the same contacts (i.e., the same person having many… Read More

Given a number line from -infinity to +infinity. You start at 0 and can go either to the left or to the right. The condition… Read More

Given an undirected graph, print all connected components line by line. For example consider the following graph. Recommended Practice Number of Provinces Try It! We… Read More

Given a list of word lists How to print all sentences possible taking one word from a list at a time via recursion? Example: Input: {{"you",… Read More

Given a directed graph, a source vertex ‘s’ and a destination vertex ‘d’, print all paths from given ‘s’ to ‘d’. Consider the following directed graph.… 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

Write a function that returns true if a given undirected graph is tree and false otherwise. For example, the following graph is a tree. But… Read More

Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on… Read More

Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the… Read More

Given an undirected graph, how to check if there is a cycle in the graph? Example, Input: n = 4, e = 4 Output: Yes Explanation: 0 1, 1… Read More

Given a directed graph, find out whether the graph is strongly connected or not. A directed graph is strongly connected if there is a path… Read More