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

10
LINES

< > BotCompany Repo | #1008780 // stringTreeLeafValue2 - also returns number of nodes travelled

JavaX fragment (include)

static <A> Pair<A, Int> stringTreeLeafValue2(StringTree2<A> tree, L<S> items) {
  int i = 0;
  while (tree != null && i < l(items)) {
    if (tree.leafValue != null)
      ret pair(tree.leafValue, i);
    tree = tree.children.get(items.get(i));
    ++i;
  }
  null;
}

Author comment

Began life as a copy of #1008779

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008780
Snippet name: stringTreeLeafValue2 - also returns number of nodes travelled
Eternal ID of this version: #1008780/3
Text MD5: a4e6b8095cd8dddddd4c7337c7566a76
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-03 17:01:52
Source code size: 276 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 510 / 572
Version history: 2 change(s)
Referenced in: [show references]