## Right sibling of each node in a tree given as array of edges

Given a tree, with N nodes and E edges (every edge is denoted by two integers, X, Y stating that X is the parent of… Read More »

Given a tree, with N nodes and E edges (every edge is denoted by two integers, X, Y stating that X is the parent of… 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 »

Given a graph and two vertices src and dest, count the total number of paths from src to dest where the length of the path… Read More »

Given a tree check if it is linear or not. 1 / \ 2 3 Linear as we can form a lime 2 1 3… Read More »

Given a directed graph represented as an adjacency matrix and an integer ‘k’, the task is to find all the vertex pairs that are connected… Read More »

In graph theory, edge coloring of a graph is an assignment of “colors” to the edges of the graph so that no two adjacent edges… 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 »

Pre-Requisites: Depth First Search | Parent Array Representation Given a parent array representation of a binary tree, we need to find the number of Isosceles… Read More »

Given n companies and m oil mines having values, the task is to distribute the mines among n companies in a fair manner. That is… Read More »

The Jump pointer algorithm is a design technique for parallel algorithms that operate on pointer structures, such as arrays or linked list. This algorithm is… Read More »

Given an undirected graph, check if it contains an independent set of size k. Print ‘Yes’ if there exists an independent set of size k.… Read More »

Given a graph with n nodes and m edges. Find the maximum possible number of nodes which are not part of any edge (m will… Read More »

A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are… Read More »