Compare commits

...

2 Commits

Author SHA1 Message Date
d77d00cb37 remove reviewboardrc
We don't use the review board anymore.
2025-04-27 10:16:10 +02:00
9845c00a9f improve documentation 2025-04-27 10:15:35 +02:00
2 changed files with 30 additions and 16 deletions

View File

@@ -1,2 +0,0 @@
REVIEWBOARD_URL = 'http:///'
REPOSITORY = 'PrimitiveCollections'

View File

@@ -106,6 +106,12 @@ class MultiwayLongMerger {
}
}
/**
* Returns the next power of two that is equal or larger than i.
* or more formally: x where x = 2^n and x >= i for n ∈ and n minimal
* @param i some positive integer
* @return smallest integer that is a power of two and equal or larger than i
*/
private static int nextPowOfTwo(int i) {
return Integer.highestOneBit(i - 1) << 1;
}
@@ -164,22 +170,32 @@ class MultiwayLongMerger {
}
/**
* A heap is a tree where the value of the parent is smaller than the value of its children.
* <pre>
* 7
* 3
* 8
* 1
* 9
* 4
* 10
* 0
* 11
* 5
* 12
* 2
* 23
* 13
* 6
* 14
* 9
* 37
* 24
* 77
* 5
* 44
* 35
* 93
* 7
* 29
* 27
* 31 ┌────────────────────────┬────┐
* ┌────┼──────────────┬────┐ │ │
* ┌────┬────┐ │ │ │ │ │ │
* ┏━━┷━┳━━━━┳━━━━┳━━┷━┳━━┷━┳━━━━┳━━━━┳━━━━┳━━━━┳━━━━┳━━━━┳━━━━┳━━━━┳━━━━┓
* ┃ 5 ┃ 9 ┃ 7 ┃ 13 ┃ 24 ┃ 35 ┃ 27 ┃ 23 ┃ 14 ┃ 37 ┃ 77 ┃ 93 ┃ 29 ┃ 31 ┃
* ┗━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┻━━━━┛
* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 (array indices)
* │ │ │ │ │ │
* └────┼────┴────┘ │ │
* └──────────────┴────┘
* </pre>
*/
private void init() {