## Print the DFS traversal step-wise (Backtracking also)

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 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 »

Graphs can be used for seemingly unconnected problems. Say the problem of cards which have numbers on both side and you try to create a… Read More »

A graph is a non-linear data structure, which consists of vertices(or nodes) connected by edges(or arcs) where edges may be directed or undirected. In Computer… Read More »

Online Round: This round was held on Hackerrank for 1:30 hrs. There were two questions in this round. A tree was given with upto 10^5 nodes.… Read More »

Given a connected graph, check if the graph is bipartite or not. A bipartite graph is possible if the graph coloring is possible using two… Read More »

Given an undirected graph, how to check if there is a cycle in the graph? For example, the following graph has a cycle 1-0-2-1. My… Read More »

Given n nodes of a tree and their connections, print Subtree nodes of every node. Subtree of a node is defined as a tree which… Read More »

Given a directed graph having n nodes. For each node, delete all the outgoing edges except the outgoing edge with minimum weight. Apply this deletion… Read More »

Given an array A of N numbers where Ai represent the value of the (i+1)th node. Also given are M pair of edges where u… Read More »

The backbone analysis of any network is broadly accomplished by using Graph Theory and its Algorithms. The performance constraints are Reliability, Delay/Throughput and the goal… Read More »

Given a grid with different colors in a different cell, each color represented by a different number. The task is to find out the largest… Read More »

Suppose there are n towns connected by m bidirectional roads. There are s towns among them with a police station. We want to find out… Read More »

Prerequisite : NP-Completeness The class of languages for which membership can be decided quickly fall in the class of P and The class of languages… Read More »

Permutation A permutation is an arrangement of elements. A permutation of n elements can be represented by an arrangement of the numbers 1, 2, …n… Read More »