## Lexicographically Smallest Topological Ordering

Given a directed graph with N vertices and M edges that may contain cycles, the task is to find the lexicographically smallest topological ordering of… Read More »

Given a directed graph with N vertices and M edges that may contain cycles, the task is to find the lexicographically smallest topological ordering of… Read More »

A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce… Read More »

Given a directed, unweighted graph with N vertices and an integer K. The task is to find the number of paths of length K for… Read More »

Given an integer N and valid subsequences of an array of integers where every element is distinct and from the range [0, N – 1],… Read More »

Given a connected graph with N vertices. The task is to select k(k must be less than or equals to n/2, not necessarily minimum) vertices… Read More »

Given a binary search tree, and an integer X, the task is to check if there exists a pair of distinct nodes in BST with… Read More »

Given an undirected unweighted graph with N vertices and M edges. The task is to find two disjoint good sets of vertices. A set X… Read More »

Given a graph with N nodes and K bidirectional edges between them find the number of nodes which can be reachable from a particular. Two… Read More »

Given an integer L which is the sum of degrees of all the vertices of some tree. The task is to find the count of… Read More »

Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weighted string… Read More »

Given a tree, and the weights (in the form of strings) of all the nodes, the task is to count the nodes whose weights does… Read More »

Given a Prufer sequence, the task is to find the degrees of all the nodes of the tree made by the prufer sequence. Examples: Input:… Read More »

Given a Prufer sequence of a Tree, the task is to print the node with the maximum degree in the tree whose Prufer sequence is… Read More »

Given a tree, and the weights of all the nodes, the task is to count the nodes whose weights are divisible by x. Examples: Input:… Read More »