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

11
LINES

< > BotCompany Repo | #1029491 - test_LongPriorityQueue (OK)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3019L/20K).

svoid test_LongPriorityQueue() {
  LongPriorityQueue q = new(-1, (a, b) -> cmp(b, a));
  q.add(3);
  q.add(1);
  q.add(10);
  q.add(100);
  q.add(-10);
  new L<Long> out;
  while (!q.isEmpty()) out.add(q.pop());
  assertEqualsVerbose(ll(100L, 10L, 3L, 1L, -10L), out);
}

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029491
Snippet name: test_LongPriorityQueue (OK)
Eternal ID of this version: #1029491/3
Text MD5: f4a128e4d283f391f10454cf73e2edc0
Transpilation MD5: fef154c4b24c40cdda5e9469ed6064d2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-15 14:37:24
Source code size: 280 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 38 / 73
Version history: 2 change(s)
Referenced in: [show references]

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