Skip to content

Category Archives: Graph

Given an Undirected Graph consisting of N vertices and M edges, where node values are in the range [1, N], and vertices specified by the… Read More
Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that there… Read More
Given a matrix board[][] consisting of the characters K or k, Q or q, B or b, N or n, R or r, and P… Read More
Given a Directed graph of N vertices and M edges, the task is to find the minimum number of edges required to make the given… Read More
Prerequisites: Graph and its representationsGiven an adjacency matrix g[][] of a graph consisting of N vertices, the task is to modify the matrix after insertion… Read More
Given an un-directed and unweighted connected graph, find a simple cycle in that graph (if it exists). Simple Cycle: A simple cycle is a cycle… Read More
Given a 2D screen arr[][] where each arr[i][j] is an integer representing the color of that pixel, also given the location of a pixel (X,… Read More
Every beginner computer science student would have once wondered why do we find shortest path in graph or what is the use of trees, are… Read More
Given a weighted, directed graph G, an array V[] consisting of vertices, the task is to find the Minimum Cost Path passing through all the… Read More
Given an integer N, which denotes the size of the matrix that is N*N. There is a robot placed over the top-left corner (0, 0)… Read More
Introduction: A Graph is a non-linear data structure consisting of vertices and edges. The vertices are sometimes also referred to as nodes and the edges… Read More
Given a directed Graph G(V, E) with V vertices and E edges, the task is to check that for all vertices of the given graph,… Read More
Given an undirected graph and two vertices X and Y, our task is to check whether the vertex X lies in the subgraph of the… Read More
Given an undirected graph defined by the number of vertex V and the edges E[ ], the task is to find Maximal Independent Vertex Set… Read More
Given a weighted directed graph consisting of V vertices and E edges. The task is to print the cyclic path whose sum of weight is… Read More

Start Your Coding Journey Now!