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

13
LINES

< > BotCompany Repo | #1001894 // makeHull - construct transitive hull over a relation (MultiMap), including object itself

JavaX fragment (include)

static L<S> makeHull(MultiMap<S, S> map, S e) {
  new L<S> l;
  makeHull_impl(map, e, l);
  ret l;
}

static void makeHull_impl(MultiMap<S, S> map, S e, L<S> dest) {
  if (dest.contains(e))
    ret;
  dest.add(e);
  for (S f : map.get(e))
    makeHull_impl(map, f, dest);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001894
Snippet name: makeHull - construct transitive hull over a relation (MultiMap), including object itself
Eternal ID of this version: #1001894/2
Text MD5: 4e759da2502958b63d1b38f883337045
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-18 13:37:55
Source code size: 287 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 759 / 947
Version history: 1 change(s)
Referenced in: [show references]