## Find maximum path length in a binary matrix

Given a square matrix mat every element of which is either 0 or 1. A value 1 means connected and 0 means not connected. The… Read More »

- Top 10 algorithms in Interview Questions
- Depth First Search or DFS for a Graph
- Detect Cycle in a Directed Graph
- Topological Sorting
- Top 10 Algorithms and Data Structures for Competitive Programming
- Find the number of islands | Set 1 (Using DFS)
- BFS vs DFS for Binary Tree
- Detect cycle in an undirected graph
- Check whether a given graph is Bipartite or not
- Strongly Connected Components
- Applications of Depth First Search
- Connected Components in an undirected graph
- Shortest path in a Binary Maze
- Hamiltonian Cycle | Backtracking-6
- Snake and Ladder Problem
- Find a Mother Vertex in a Graph
- Print all paths from a given source to a destination
- Iterative Depth First Traversal of Graph
- Count all possible paths between two vertices
- Detect Cycle in a directed graph using colors
- Boggle (Find all possible words in a board of characters) | Set 1
- Boggle | Set 2 (Using Trie)
- Minimum steps to reach a destination
- Articulation Points (or Cut Vertices) in a Graph
- Find length of the largest region in Boolean Matrix
- Check if a graph is strongly connected | Set 1 (Kosaraju using DFS)
- Print all Jumping Numbers smaller than or equal to a given value
- Count all possible walks from a source to a destination with exactly k edges
- Print all the cycles in an undirected graph
- Diameter of a tree using DFS

Given a square matrix mat every element of which is either 0 or 1. A value 1 means connected and 0 means not connected. The… Read More »

Given integers ‘N’ and ‘K’ where, N is the number of vertices of an undirected graph and ‘K’ denotes the number of edges in the… Read More »

Given a Markov chain G, we have the find the probability of reaching the state F at time t = T if we start from… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

Given a boolean 2D matrix. The task is to find the number of distinct islands where a group of connected 1s (horizontally or vertically) forms… Read More »

Given a m x n matrix of positive integers. The task is to find the number of paths from the top left of the matrix… Read More »

Consider a directed graph given in below, DFS of the below graph is 1 2 4 6 3 5 7 8. In below diagram if… Read More »

Given a Binary tree, Traverse it using DFS using recursion. Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical… Read More »

Given an undirected and unweighted graph. The task is to find the product of the lengths of all cycles formed in it. Example 1: The… Read More »

Given a Binary Tree and a Level. The task is to find the node with the maximum value at that given level. Recommended: Please try… Read More »

Given a tree of N nodes and N-1 edges. Also given an integer M and a node, the task is to print the M-th node… Read More »

Given a tree of N nodes and N-1 edges. The task is to print the DFS of the subtree of a given node for multiple… Read More »

Given an undirected graph, print all the vertices that form cycles in it. Pre-requisite: Detect Cycle in a directed graph using colors In the above… Read More »

Given a graph, the task is to print the DFS traversal of a graph which includes the every step including the backtracking. 1st step:- 0… Read More »

Given an array of words, find any alphabetical order in the English alphabet such that the given words can be considered sorted (increasing), if there… Read More »