TheAlgorithms / Ruby

All algorithms implemented in Ruby
MIT License
1.18k stars 292 forks source link

Implementing topological sorting for DAGs #208

Closed aparibocci closed 1 year ago

aparibocci commented 1 year ago

This MR aims to provide topological sorting capabilities for directed acyclic graphs.

Topological sorting runs in O(|V|), where |V| is the number of graph nodes.

Unit tests are included.

aparibocci commented 1 year ago

Hello @StepfenShawn, could I ask you to have a look at this MR when you have the opportunity?

Thank you in advance!