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

18
LINES

< > BotCompany Repo | #1008649 // addToStringTree

JavaX fragment (include)

ifclass StringTree1
static void addToStringTree(StringTree1 tree, L<S> tokC) {
  if (empty(tokC)) { tree.leaf = true; ret; }
  S s = first(tokC);
  StringTree1 t = tree.getOrAdd(s);
  addToStringTree(t, dropFirst(tokC));
}
endif

ifclass StringTree2
static <A> void addToStringTree(StringTree2<A> tree, L<S> tokC, A leafValue) {
  if (leafValue == null) ret;
  if (empty(tokC)) { tree.leafValue = leafValue; ret; }
  S s = first(tokC);
  StringTree2 t = tree.getOrAdd(s);
  addToStringTree(t, dropFirst(tokC), leafValue);
}
endif

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: #1008649
Snippet name: addToStringTree
Eternal ID of this version: #1008649/6
Text MD5: f1e4ef8608460770b891bd128acb941f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-03 16:47:31
Source code size: 546 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 436 / 484
Version history: 5 change(s)
Referenced in: [show references]