Tag Archives: graph-cycle

Given an array arr[] consisting of first N natural numbers, construct a undirected graph using the array elements such that for any array element, connect… Read More
Given an undirected graph with N vertices and N edges that contain only one cycle, and an array arr[] of size N, where arr[i] denotes… Read More
Given a directed graph G N nodes and E Edges consisting of nodes valued [0, N – 1] and a 2D array Edges[][2] of type… Read More
Given a graph G consisting of nodes valued [0, N – 1], a source S, and an array Edges[][3] of type {u, v, w} that… Read More
Given an undirected graph consisting of N nodes containing values from the range [1, N] and M edges in a matrix Edges[][], the task is… Read More
Given a 2D grid arr[][] with different characters, the task is to detect whether it contains a cycle or not. A sequence of characters or… 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 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
Given an undirected graph consisting of N vertices numbered [0, N-1] and E edges, the task is to count the number of cycles such that… Read More
Given a non-cyclic graph having V nodes and E edges and a source node S, the task is to calculate the sum of the minimum… Read More
Given an N-sided regular polygon, we have connected all the vertices at the center of the polygon, thus dividing the polygon into N equal parts.… Read More
Given a read-only array arr[] of size N + 1, find one of the multiple repeating elements in the array where the array contains integers… Read More
Given an array arr[] containing N intervals, the task is to check that if the intervals can be added or subtracted by X after which… Read More
Given an array A containing N integers, the task is to count the number of elements which form a cycle in the array, based on… Read More
Given an undirected graph of N nodes labelled from 1 to N, the task is to find the minimum labelled node that should be removed… Read More