File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/algorithms/explanations Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,17 @@ most) bit of each key and working down to the least significant bit.
13
13
14
14
## The algorithm
15
15
16
- ### 1. Initial Setup:
16
+ ### 1. Initial Setup
17
17
* The ``` Rexsort ``` function sets up the sorting process by determining the
18
18
most significant bit position in the array elements.
19
19
* A * mask* is created that has a 1 in this bit position and 0 elsewhere. The
20
20
mask is used to extract bits from keys during sorting.
21
21
* The recursive sorting function ``` RexsortRecursive ``` is then called to
22
22
sort the entire array starting with this mask. The mask is shifted to the
23
23
right for recursive calls.
24
- ### 2. Recursive Sorting:
24
+ ### 2. Recursive Sorting
25
+ This has a very similar structure to the quicksort algorithm.
26
+
25
27
* The ``` RexsortRecursive ``` function works on sub-arrays, defined by a left
26
28
and right index, and additionally has the current mask as a parameter.
27
29
* If the sub-array contains no more than one element or the mask is 0, the
You can’t perform that action at this time.
0 commit comments