Skip to content

Tag Archives: disjoint-set

Prerequisites: DFS, Trees, DSUGiven a tree with of N nodes from value 1 to N and E edges and array arr[] which denotes number associated… Read More
Given an array arr[] consisting of N integers, consisting only of 0‘s initially and queries Q[][] of the form {L, R, C}, the task for… Read More
Given a boolean matrix mat[][] consisting of N rows and M columns, initially filled with 0‘s(empty cells), an integer K and queries Q[][] of the… Read More
Given an undirected graph consisting of N vertices and M edges and queries Q[][] of the type {X, Y}, the task is to check if… Read More
Given a graph consisting of N nodes numbered from 0 to N – 1 and M edges in the form of pairs {a, b}, the… Read More
In this article, we will generate test cases such that given set edges form a Tree. Below are the two conditions of the Tree: It… Read More
Given Two Strings s1 and s2 containing only lowercase letters of same length. The task is to make these strings equal by using the minimum… Read More
Given N nodes on a 2-D plane represented as (xi, yi). The nodes are said to be connected if the manhattan distance between them is… Read More
Given a graph with N nodes having values either P or M. Also given K pairs of integers as (x, y) representing the edges in… Read More

Start Your Coding Journey Now!