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

8
LINES

< > BotCompany Repo | #1005381 // percentageSorted

JavaX fragment (include)

static double percentageSorted(L l) {
  if (l(l) < 2) ret 100;
  int sorted = 0;
  for (int i = 0; i < l(l)-1; i++)
    if (cmp(l.get(i), l.get(i+1)) <= 0)
      ++sorted;
  ret sorted*100.0/(l(l)-1);
}

Author comment

Began life as a copy of #1005380

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005381
Snippet name: percentageSorted
Eternal ID of this version: #1005381/1
Text MD5: a4b7bc133019012cf5a7a626a015323a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-10 17:32:27
Source code size: 209 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 524 / 506
Referenced in: [show references]