MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / getNPerm

Method getNPerm

app/src/main/java/cs/min2phase/Util.java:273–284  ·  view source on GitHub ↗
(int[] arr, int n)

Source from the content-addressed store, hash-verified

271 }
272
273 static int getNPerm(int[] arr, int n) {
274 int idx = 0;
275 for (int i = 0; i < n; i++) {
276 idx *= (n - i);
277 for (int j = i + 1; j < n; j++) {
278 if (arr[j] < arr[i]) {
279 idx++;
280 }
281 }
282 }
283 return idx;
284 }
285
286 static int getComb(int[] arr, int mask) {
287 int end = arr.length - 1;

Callers 4

resolvePermMethod · 0.95
randomStateMethod · 0.95
verifyMethod · 0.95
UtilClass · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected