How to sort depended objects by dependency

后端 未结 10 550
青春惊慌失措
青春惊慌失措 2020-11-28 19:31

I have a collection:

List> dependencyHierarchy;

The first item in pair is some object (item) and the

10条回答
  •  情歌与酒
    2020-11-28 20:11

    Perfect example to use a topological sort :

    http://en.wikipedia.org/wiki/Topological_sorting

    It will give you exactly what you need.

提交回复
热议问题