# Category Archives: Graph

Given a 2D array Edges[][], representing a directed edge between the pair of nodes in a Directed Acyclic Connected Graph consisting of N nodes valued… Read More
Given a Graph consisting of N vertices and M weighted edges and an array edges[][], with each row representing the two vertices connected by the… Read More
Given an array arr[] consisting of values of N vertices of an initially unconnected Graph and an integer M, the task is to connect some… Read More
Prerequisite: Conflict Serializability, Precedence Graph Conflict Serializable Schedule: A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping… Read More
Given an integer N, representing the number of nodes present in an undirected graph, with each node valued from 1 to N, and a 2D… Read More
Given an N-ary tree consisting of N nodes having values 0 to (N – 1), the task is to find the total number of subtrees… Read More
Given a 2D array arr[][] of dimensions N*M, representing a minesweeper matrix, where each cell contains an integer from the range [0, 9], representing the… Read More
Independent sets are set of vertices or edges in which the pair of any two vertices or edges are not adjacent to each other. Assuming… Read More
Given an undirected graph consisting of V vertices and a 2d array E[] denoting edges between pairs of nodes. Given another array arr[] representing values… Read More
A Graph is a non-linear data structure used for the representation of a set of objects where some pairs of objects are connected. The interconnected… Read More
Given an undirected graph G with vertices numbered in the range [1, N] and an array Edges[][] consisting of M edges, the task is to… Read More
Given an integer N, denoting the number of computers connected by cables forming a network and a 2D array connections[][], with each row (i, j)… Read More
Given an array of strings arr[], where each arr[i] is of the form “i==j” or “i!=j”, where i and j are variables representing relationships among… Read More
A feedback vertex set of a graph is a set of vertices whose removal leaves a graph without cycles. The following graph becomes a Directed… Read More
In a graph with V vertices and E edges, the LIS (Largest Independent Set) is the set of all the vertices in the graph which… Read More