Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1021589 // treeView_allNodes - in some weird order

JavaX fragment (include)

1  
static <A> L<A> treeView_allNodes(TreeView<A> t) {
2  
  new L<A> out;
3  
  if (t == null) ret out;
4  
  TreeView<A> parent;
5  
  while ((parent = t.parent()) != null) t = parent;
6  
  new L<TreeView<A>> stack;
7  
  stack.add(t);
8  
  while (nempty(stack)) {
9  
    t = popLast(stack);
10  
    out.add(t.node());
11  
    addAll(stack, t.children());
12  
  }
13  
  ret out;
14  
}

Author comment

Began life as a copy of #1021572

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021589
Snippet name: treeView_allNodes - in some weird order
Eternal ID of this version: #1021589/5
Text MD5: 5bc5d85ddd5172081a76a814ee6365ae
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-19 17:15:04
Source code size: 346 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 326 / 324
Version history: 4 change(s)
Referenced in: [show references]