sir
what this LIST ordering func will do;
and what this ordering.push_front(node) will do
Doubt in tropological sort using dfs
In topological sort…in the DFS approach, you have to push the node into the list when there are no neighboring nodes left to visit. The order of the nodes as in topological sort is formed by pushing the nodes in the front of the list. This cannot be done in a vector/array as there is no push_front function with that.So we use list.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.