it's called topological sorting
# beginners-need-help
d
it's called topological sorting