logo

SEE ALGORITHMS

    Bubble SortInsertion SortSelection SortRadix SortHeap SortMerge SortQuick Sort
Graph
    Depth First SearchBreadth First SearchPrim's AlgorithmKruskal's AlgorithmDijkstra's AlgorithmTopological SortingHamiltonian Cycle
    Binary Search TreeBinary HeapCircular Queue
    Convex HullHuffman Coding
Topological Sorting

Topological Sorting is an ordering of nodes in a directed acyclic graph (DAG) where each node appears before all the nodes it points to. It is like creating a list of tasks, ensuring that each task comes after any tasks it depends on. The sorting can be achieved using Kahn's algorithm or DFS with a stack. Kahn's algorithm works by repeatedly removing nodes with no incoming edges (zero in-degree) and adding them to the order.

Draw Graph