Tutorials
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
19.9K+ articles
Misc
7.8K+ articles
Mathematical
5.1K+ articles
Graph
560+ articles
DFS
359+ articles
BFS
228+ articles
graph-cycle
58+ articles
Graph Traversals
45+ articles
connected-components
31+ articles
graph-connectivity
64 posts
Recent Articles
Popular Articles
Make given segments non-overlapping by assigning directions
Last Updated: 30 June 2021
Given an array arr[][] consisting of N segments of the form {L, R, V} where, [L, R] denotes a segment with velocity V in any direction, the task is to check if it is possi...
read more
DSA
BFS
graph-connectivity
Graph Traversals
Graph Coloring
Maximum product of a pair of nodes from largest connected component in a Graph
Last Updated: 21 May 2024
Given an undirected weighted graph G consisting of N vertices and M edges, and two arrays Edges[][2] and Weight[] consisting of M edges of the graph and weights of each ed...
read more
Misc
Graph
Searching
Mathematical
Recursion
DSA
DFS
graph-connectivity
Graph Traversals
Find a set of at most N/2 nodes from a Graph such that all remaining nodes are directly connected to one of the chosen nodes
Last Updated: 07 March 2023
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 array Edges[][], representing the pair of ...
read more
Graph
Queue
Searching
DSA
BFS
graph-connectivity
Graph Traversals
cpp-queue
Union and Intersection of two Graphs
Last Updated: 31 January 2023
Given two graphs G1 and G2, the task is to find the union and intersection of the two given graphs, i.e. (G1 ∪ G2) and (G1 ∩ G2).Examples:Input: G1 = { ("e1", 1, 2), ("e2"...
read more
Graph
Searching
Mathematical
Hash
DSA
DFS
graph-connectivity
Graph Traversals
Connect a graph by M edges such that the graph does not contain any cycle and Bitwise AND of connected vertices is maximum
Last Updated: 30 April 2021
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 vertices of the graph with exactly ...
read more
Misc
Bit Magic
Graph
Mathematical
DSA
graph-connectivity
Bitwise-AND
connected-components
Count permutations of first N natural numbers having sum of adjacent elements equal to a perfect square
Last Updated: 02 July 2021
Given a positive integer N, the task is to find the number of unique permutations of first N natural numbers having sum of the adjacent elements equal to a perfect square....
read more
Graph
Greedy
Mathematical
DSA
permutation
graph-connectivity
Graph Traversals
Minimize number of notes required to be distributed among students
Last Updated: 01 February 2023
Given an array arr[] consisting of N strings representing the name of the students in the class and another array of pairs P[][2] such that P[i][0] likes P[i][1], the task...
read more
DSA
graph-connectivity
Graph Traversals
graph-cycle
connected-components
Print all Hamiltonian Cycles in an Undirected Graph
Last Updated: 25 October 2021
Given an undirected Graph consisting of N nodes in the form of an adjacency matrix graph[][] of size N*N, the task is to print all Hamiltonian cycles possible in the given...
read more
DSA
graph-connectivity
Graph Traversals
graph-cycle
Finding Astronauts from different countries
Last Updated: 23 September 2021
Given a positive integer N denoting the number of astronauts(labelled from 0 from (N - 1))and a matrix mat[][] containing the pairs of astronauts that are from the same co...
read more
DSA
DFS
graph-connectivity
Graph Traversals
Count all Hamiltonian paths in a given directed graph
Last Updated: 24 January 2023
Given a directed graph of N vertices valued from 0 to N - 1 and array graph[] of size K represents the Adjacency List of the given graph, the task is to count all Hamilton...
read more
DSA
graph-connectivity
Graph Traversals
graph-cycle
The Earliest Moment When Everyone Become Friends
Last Updated: 24 March 2023
Given a group of N people, each having a unique ID value from 0 to (N - 1) and an array arr[] of M elements of the form {U, V, time} representing that the person U will be...
read more
Misc
Tree
Graph
Mathematical
DSA
graph-connectivity
union-find
graph-cycle
disjoint-set
Interview-Questions
What is K-connected Graph?
Last Updated: 03 January 2024
A k-connected graph is a type of graph where removing k-1 vertices (and edges) from the graph does not disconnect it. In other words, there are at least k distinct paths b...
read more
Graph
Picked
DSA
Definitions and Meanings
graph-connectivity
Kahn's Algorithm vs DFS Approach: A Comparative Analysis
Last Updated: 19 October 2023
Topological sorting is a common problem in computer science that involves arranging the vertices of a directed acyclic graph (DAG) in a linear order such that for every di...
read more
Graph
Stack
Sorting
DSA
Topological Sorting
graph-connectivity
Data Structures
Data Structures-Tree Traversals
Data Structures-Stack
Data Structures-Graph
Minimum difference between components of the Graph after each query
Last Updated: 17 October 2023
Given an integer N, denoting the total number of Nodes in a graph without any edges, you have to process Q queries of the form u, v which denotes that you have to add an e...
read more
Graph
DSA
graph-connectivity
disjoint-set
Adjacency List Generation from Edge Connections
Last Updated: 04 December 2023
Given a list of undirected edge connections of size E, create an adjacency list for a graph with V nodes and E edges following 0-based indexing and return the adjacency li...
read more
Graph
Geeks Premier League
DSA
graph-connectivity
Geeks Premier League 2023
1
2
3
4
5
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !