Computer scienceAlgorithms and Data StructuresAlgorithmsGraph algorithmsTopological sorting algorithms

DFS-based topological sort

Find the order

Report a typo

Here are some steps in a chaotic order. Arrange the options in the correct order to obtain instruction for the topological sort algorithm, introduced in this topic:

Put the items in the correct order
Otherwise, we repeat the procedure recursively for every child of our node.
Choose an unvisited node to begin the procedure.
If the node is already visited, the procedure is done.
If there are no recursive calls to be made, we mark our node as visited and add it at the beginning of the list.
___

Create a free account to access the full topic