## Minimum edges to be added in a directed graph so that any node can be reachable from a given node

Given a directed graph and a node X. The task is to find the minimum number of edges that must be added to the graph… Read More »

- Maximum number of edges among all connected components of an undirected graph
- Find the ordering of tasks from given dependencies
- Find whether it is possible to finish all tasks or not from given dependencies
- Sum of all odd nodes in the path connecting two given nodes
- Minimum number of edges between two vertices of a graph using DFS
- Unique paths covering every non-obstacle block exactly once in a grid
- Find maximum path length in a binary matrix
- Count the number of nodes at a given level in a tree using DFS
- Level with maximum number of nodes using DFS in a N-ary tree
- De Bruijn sequence | Set 1
- Minimum time to return array to its original state after given modifications
- DP on Trees | Set-3 ( Diameter of N-ary Tree )
- Printing pre and post visited times in DFS of a graph
- Perform the given queries on the rooted tree
- Minimum edges to be added in a directed graph so that any node can be reachable from a given node
- Find the probability of a state at a given time in a Markov chain | Set 1
- Print levels with odd number of nodes and even number of nodes

Given a directed graph and a node X. The task is to find the minimum number of edges that must be added to the graph… Read More »

Given an N-ary tree T of N nodes, the task is to calculate the longest path between any two nodes(also known as the diameter of… Read More »

Given an integer l and a tree represented as an undirected graph rooted at vertex 0. The task is to print the number of nodes… Read More »

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

Given a grid grid[][] with 4 types of blocks: 1 represents the starting block. There is exactly one starting block. 2 represents the ending block.… Read More »

Depth First Search (DFS) marks all the vertices of a graph as visited. So for making DFS useful, some additional information can also be stored.… Read More »

Given a N-ary tree, the task is to print the level with the maximum number of nodes. Examples: Input : For example, consider the following… Read More »

Given a binary tree and two nodes of that binary tree. Find the sum of all nodes with odd values in the path connecting the… 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 »

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 an integer n and a set of characters A of size k, find a string S such that every possible string on A of… Read More »

Given two arrays of integers arr and P such that after a cycle an element arr[i] will be at location arr[P[i]]. The task is to… Read More »

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 »