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

6
LINES

< > BotCompany Repo | #1009544 - setIntersection

JavaX fragment (include)

static <A> Set<A> setIntersection(Set<A> a, Collection<A> b) {
  Set<A> set = similarEmptySet(a);
  Set<A> bSet = asSet(b);
  for (A x : a) if (bSet.contains(x)) set.add(x);
  ret set;
}

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1009544
Snippet name: setIntersection
Eternal ID of this version: #1009544/3
Text MD5: 231eccf5e5920b9e38cedde50c237428
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-10 20:14:53
Source code size: 191 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 290 / 318
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009544 & http://1009544.tinybrain.de