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

10
LINES

< > BotCompany Repo | #1013507 // multiSetTopTenPairs

JavaX fragment (include)

1  
static <A> L<Pair<A, Int>> multiSetTopTenPairs(MultiSet<A> ms) {
2  
  ret multiSetTopTenPairs(ms, 10);
3  
}
4  
5  
static <A> L<Pair<A, Int>> multiSetTopTenPairs(MultiSet<A> ms, int n) {
6  
  new L<Pair<A, Int>> l;
7  
  for (A a : ms.getTopTen(n))
8  
    l.add(pair(a, ms.get(a)));
9  
  ret l;
10  
}

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: #1013507
Snippet name: multiSetTopTenPairs
Eternal ID of this version: #1013507/3
Text MD5: 83fa3d0276e9a7ac38037a8103a130d4
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-09 11:03:57
Source code size: 280 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 424 / 480
Version history: 2 change(s)
Referenced in: [show references]