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

13
LINES

< > BotCompany Repo | #1021566 // gazelle_searchTree_breadthFirst_backwards

JavaX fragment (include)

1  
static GazelleTree gazelle_searchTree_breadthFirst_backwards(F1<GazelleTree, Bool> pred, L<GazelleTree> nodes) {
2  
  new LinkedList<GazelleTree> queue;
3  
  addAllReversed(queue, nodes);
4  
  while (nempty(queue)) {
5  
    GazelleTree t = popFirst(queue);
6  
    if (checkCondition(pred, t)) ret t;
7  
    if (t.isSplitNode)
8  
      addAllReversed(queue, t.children);
9  
    else
10  
      addAll(queue, t.children);
11  
  }
12  
  null;
13  
}

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: #1021566
Snippet name: gazelle_searchTree_breadthFirst_backwards
Eternal ID of this version: #1021566/3
Text MD5: af9f308897fd187d65849fe65e9ab459
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-18 16:34:52
Source code size: 416 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 385 / 377
Version history: 2 change(s)
Referenced in: [show references]