## Minimum cost to reverse edges such that there is path between every pair of nodes

Given a connected, directional graph. Each node is connected to exactly two other nodes. There is weight associated with each edge denoting the cost to… Read More »

- Introduction to Data Structures | 10 most commonly used Data Structures
- Lexicographically Smallest Topological Ordering
- Find the minimum number of moves to reach end of the array
- Print all neighbour nodes within distance K
- Check which player visits more number of Nodes
- Pair with a given sum in BST | Set 2
- Find the number of paths of length K in a directed graph
- Print the path between any two nodes of a tree | DFS
- Maximum number of nodes which can be reached from each node in a graph.
- Find the winner of the match | Multiple Queries
- Implementation of BFS using adjacency matrix
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Find the maximum cost path from the bottom-left corner to the top-right corner
- Find K vertices in the graph which are connected to at least one of remaining vertices
- Find two disjoint good sets of vertices in a given graph
- Print nodes having maximum and minimum degrees
- Shortest cycle in an undirected unweighted graph
- Product of minimum edge weight between all pairs of a Tree
- Convert Directed Graph into a Tree
- Build original array from the given sub-sequences
- Widest Path Problem | Practical application of Dijkstra's Algorithm
- Implementing Generic Graph in Java
- Find if a degree sequence can form a simple graph | Havel-Hakimi Algorithm

Given a connected, directional graph. Each node is connected to exactly two other nodes. There is weight associated with each edge denoting the cost to… Read More »

Given an unweighted directed graph and Q queries consisting of sequences of traversal between two nodes of the graph, the task is to find out… Read More »

Given an undirected graph with N vertices and N edges. No two edges connect the same pair of vertices. A triangle is a set of… Read More »

Given a connected acyclic graph with N nodes and N-1 edges, find out the pair of nodes that are at even distance from each other.… Read More »

Given N dependencies of the form X Y, where X & Y represents two different tasks. The dependency X Y denotes dependency of the form… Read More »

Given two integers N and K. The task is to find a connected graph with N vertices such that there are exactly K pairs (i,… Read More »

In graph theory, vertex colouring is a way of labelling each individual vertex such that no two adjacent vertex have same colour. But we need… Read More »

Given a dictionary, and two words start and target (both of the same length). Find length of the smallest chain from start to target if… Read More »

Given an undirected graph having N nodes, the task is to print the nodes having minimum and maximum degree. Examples: Input: 1—–2 | | 3—–4… Read More »

It is highly recommended to read Dijkstra’s algorithm using the Priority Queue first. Widest Path Problem is a problem of finding a path between two… Read More »

Given an array arr[] of size N. There is an edge from i to arr[i]. The task is to convert this directed graph into tree… Read More »

Breadth First Search (BFS) has been discussed in this article which uses adjacency list for the graph representation. In this article, adjacency matrix will be… Read More »

Given an array arr[] of size N where every element is from the range [0, 9]. The task is to reach the last index of… Read More »

Given a sequence of non-negative integers arr[], the task is to check if there exists a simple graph corresponding to this degree sequence. Note that… Read More »

Given a graph of N nodes, E edges, a node X and a distance K. The task is to print all the nodes within the… Read More »