Tutorials
Courses
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
37.4K+ articles
DSA
21.3K+ articles
Competitive Programming
3.1K+ articles
Algorithms
1.9K+ articles
Sorting
1.7K+ articles
Dynamic Programming
1.6K+ articles
Graph
925+ articles
DFS
359+ articles
BFS
228+ articles
Shortest Path
71+ articles
Topological Sorting
32 posts
Recent Articles
Popular Articles
Check if it is possible to finish all task from given dependencies (Course Schedule I)
Last Updated: 11 March 2024
There are a total of N tasks, labeled from 0 to N-1. Some tasks may have prerequisites, for example to do task 0 you have to first complete task 1, which is expressed as a...
read more
Graph
Technical Scripter
Technical Scripter 2018
DSA
BFS
DFS
Topological Sorting
graph-cycle
Find the ordering of task from given dependencies (Course Schedule II)
Last Updated: 01 December 2023
Given a total of N tasks that you have to pick, labelled from 0 to N-1. Some tasks may have prerequisite tasks, for example, to pick task 0 you have to first finish task 1...
read more
Graph
Technical Scripter
Technical Scripter 2018
DSA
BFS
DFS
Topological Sorting
Find the winner of the match | Multiple Queries
Last Updated: 22 February 2023
Given an array of pairs arr of size N which represents a game situation where the first player wins against the second player. Given multiple queries, each query contains ...
read more
Graph
Searching
Sorting
DSA
Arrays
Topological Sorting
Lexicographically Smallest Topological Ordering
Last Updated: 03 April 2024
Given a directed graph with N vertices and M edges that may contain cycles, the task is to find the lexicographically smallest topological ordering of the graph if it exis...
read more
Graph
Algorithms
Binary Search Tree
Competitive Programming
DSA
Topological Sorting
Check if the given array can be constructed uniquely from the given set of subsequences
Last Updated: 10 February 2023
Given an array arr of distinct elements and a list of subsequences seqs of the array, the task is to check whether the given array can be uniquely constructed from the giv...
read more
Graph
Algorithms
Competitive Programming
DSA
Topological Sorting
Detect cycle in Directed Graph using Topological Sort
Last Updated: 30 October 2022
Given a Directed Graph consisting of N vertices and M edges and a set of Edges[][], the task is to check whether the graph contains a cycle or not using Topological sort.T...
read more
Graph
Searching
Sorting
Competitive Programming
Recursion
DSA
DFS
Topological Sorting
Graph Traversals
Minimum time taken by each job to be completed given by a Directed Acyclic Graph
Last Updated: 19 April 2024
Given a Directed Acyclic Graph having V vertices and E edges, where each edge {U, V} represents the Jobs U and V such that Job V can only be started only after completion ...
read more
Graph
Algorithms
Greedy
DSA
BFS
Topological Sorting
Data Structures-Graph
Algorithms-Graph Traversals
Graph Traversals
Equivalent Serial Schedule of Conflict Serializable Schedule in DBMS
Last Updated: 25 April 2023
Prerequisite: Conflict Serializability, Precedence GraphConflict Serializable Schedule: A schedule is called conflict serializable if it can be transformed into a serial s...
read more
Graph
DBMS
DSA
Topological Sorting
DBMS-Transactions and Concurrency Control
Check if given Arrays have a Unique Shortest Common Super-sequence
Last Updated: 20 June 2022
Given a 2D array arr[][] of size N*M which denotes N arrays, each of size M. The task is to check if all these arrays have a unique common supersequence.Examples:Input: N ...
read more
Algo Geek
Algo-Geek 2021
DSA
Arrays
Topological Sorting
Minimize colours to paint graph such that no path have same colour
Last Updated: 24 March 2023
Given a directed graph with N nodes and M connections shown in the matrix mat[] where each element is of the form {xi, yi} denoting a directed edge from yi to xi. The task...
read more
Graph
Greedy
DSA
BFS
Topological Sorting
Graph Coloring
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
Check if permutation of size N can form uniquely
Last Updated: 28 April 2023
Given array A[][2] of size M, form a new array B[] of size N, for every i from 1 to M we know BA[i][0] BA[i][1]. The task for this problem is to know if a permutation of ...
read more
Graph
DSA
BFS
Topological Sorting
Shortest Path Algorithm Tutorial with Problems
Last Updated: 23 November 2023
In this article, we are going to cover all the commonly used shortest path algorithm while studying Data Structures and Algorithm. These algorithms have various pros and c...
read more
Competitive Programming
DSA
Dijkstra
BFS
Shortest Path
DFS
Topological Sorting
bellman-ford
Floyd-Warshall
Shortest Supersequence by Sequence Reconstruction
Last Updated: 30 April 2024
Given an array arr[] and a 2D array sequences[], determine if arr is the shortest possible and the only supersequence for the given sequences. A supersequence is a sequenc...
read more
Graph
Picked
DSA
Google
Topological Sorting
Find Course Schedule II
Last Updated: 16 April 2025
Given n courses, labeled from 0 to n - 1 and an array prerequisites[] where prerequisites[i] = [x, y] indicates that we need to take course y first if we want to take cour...
read more
Graph
Picked
DSA
Amazon
Topological Sorting
1
2
3
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 !