## Recursively print all sentences that can be formed from list of word lists

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:… Read More »

- Count total ways to reach destination from source in an undirected Graph
- Paranthesis Theorem
- Find a Mother vertex in a Graph using Bit Masking
- Single source shortest path between two cities
- Minimum Cost of Simple Path between two nodes in a Directed and Weighted Graph
- Find any simple cycle in an undirected unweighted Graph
- Detect cycle in Directed Graph using Topological Sort
- Count nodes in the given tree whose weight is a fibonacci number
- Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting
- Smallest number containing all possible N length permutations using digits 0 to D
- Queries to find the Minimum Weight from a Subtree of atmost D-distant Nodes from Node X
- Minimum time required to visit all the special nodes of a Tree
- Minimum edges required to make a Directed Graph Strongly Connected
- Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
- Minimum labelled node to be removed from undirected Graph such that there is no cycle
- Lowest Common Ancestor for a Set of Nodes in a Rooted Tree
- Queries to find sum of distance of a given node to every leaf node in a Weighted Tree
- Count of elements which form a loop in an Array according to given constraints
- Count ways to change direction of edges such that graph becomes acyclic
- Minimum value of distance of farthest node in a Graph
- Find dependencies of each Vertex in a Directed Graph
- Largest subarray sum of all connected components in undirected graph
- Find GCD of each subtree of a given node in an N-ary Tree for Q queries
- Check if vertex X lies in subgraph of vertex Y for the given Graph
- Count of unique lengths of connected components for an undirected graph using STL
- Minimum Bipartite Groups
- Count the nodes in the given Tree whose weight is a Perfect Number
- Largest component size in a graph formed by connecting non-co-prime nodes
- Find the node at the centre of an N-ary tree
- Find the maximum component size after addition of each edge to the graph

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:… 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… 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 snake and ladder board, find the minimum number of dice throws required to reach the destination or last cell from source or 1st… 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… 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 »

A vertex in an undirected connected graph is an articulation point (or cut vertex) iff removing it (and edges through it) disconnects the graph. Articulation… Read More »

A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph… Read More »

Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More »

A Bipartite Graph is a graph whose vertices can be divided into two independent sets, U and V such that every edge (u, v) either… Read More »

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

Hamiltonian Path in an undirected graph is a path that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path… Read More »