我有一个链接列表,其中添加一个对象就像一棵树,下面是打印输出 LinkedList nodeList = new LinkedList();颠倒链接列表的顺序
(结果A)
1 : Tester Meeting
2 : Adminstrative & Operational
3 : Functional Committees
4 : Aduit Committee
9 : Supporting Services Development
8 : Medical Services Development
7 : Information Technology Services
6 : Human Resources Committee
15 : test2-2
14 : test2
13 : test1-1
12 : test1
5 : Finance Committee
10 : Regional Advisory Committees
11 : Board Workshop
(结果B)下面列出的是正确的顺序
Tester Meeting
Adminstrative & Operational
Functional Committees
Aduit Committee
Finance Committee
test1
test1-1
test2
test2-2
Human Resources Committee
Information Technology Services
Medical Services Development
Supporting Services Development
Regional Advisory Committees
Board Workshop
所以,我要扭转的审计委员会的子节点的顺序( ResultA)输出与ResultB相同的结果,是否有任何方法来排序链表的特定节点?
LinkedList不是的一棵树,所以 '子节点' 是如何实现的? –
这不是排序树的问题,而是你如何走树。 –
LinkedList排序不好,任何你不使用List <>的原因? –