Skip to content

Category Archives: Graph

Given an undirected graph g, the task is to find the number of coalitions formed in it after the removal of Q vertices and maximum… Read More
Given a tree of N nodes, the task is to find the maximum number of edges that can be added to the tree such that… Read More
Given a string str and K pair of characters, the task is to check if string str can be made Palindrome, by replacing one character… Read More
Given a grid[][] containing 0s and 1s, where ‘0’ represents water and ‘1’ represents land. Given that an island is a group of land (1s)… Read More
The push–relabel algorithm (alternatively, pre flow–push algorithm) is an algorithm for computing maximum flows in a flow network. Push-relabel algorithms work in a more localized… Read More
Given a tree with N nodes and (N-1) edges and source node is at 1st position. There are Q queries, each of the type {pos,… Read More
Given an undirected graph with N nodes and two vertices S & T, the task is to check if a cycle between these two vertices… Read More
Given an undirected graph with N nodes and E edges, followed by E edge connections. The task is to find the count of nodes with… Read More
Consider a set A and U denotes the universal set then complement of set A can be found by Ac =U-A. But, a graph G(v,… Read More
Given a graph with N vertices numbered from 0 to (N-1) and a matrix edges[][] representing the edges of the graph, the task is to… Read More
Given 1 to N vertices of a non-cyclic undirected graph with (N-1) edges. The task is to assign values to these edges so that the… Read More
Floyd’s cycle finding algorithm or Hare-Tortoise algorithm is a pointer algorithm that uses only two pointers, moving through the sequence at different speeds. This algorithm… Read More
Given a string Str of N characters and two strings S1 and S2 of equal length where S1[i] and S2[i] are related to each other,… Read More
Given a directed weighted graph represented by a 2-D array graph[][] of size n and 3 integers src, dst, and k representing the source point,… Read More
Given a directed acyclic graph of N nodes, the task is to find the smallest set of vertices from which the complete graph can be… Read More

Start Your Coding Journey Now!