Topological Sorting
Sort
Example:
var items = new List<string> { "A", "B", "C", "D" };
var dependencies = new Dictionary<string, List<string>>
{
{ "A", new List<string> { "B", "C" } },
{ "B", new List<string> { "C", "D" } },
{ "C", new List<string> { "D" } },
{ "D", new List<string>() }
};
var sortedItems = TopoSort.Sort(items, item => dependencies[item]);
// sortedItems will be ["D", "C", "B", "A"]Last updated

