Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Algorithms II: 3-way radix quicksort

$
0
0
Suppose that you run 3-way radix quicksort (do not shuffle) on the following
array of 12 strings:

    7637 8658 3548 2618 4264 8833 6517 4646 8688 7571 7116 3617 

What is the array immediately after the first partitioning step?
Here is the contents of the array after each step:

     lt   i  gt     0    1    2    3    4    5    6    7    8    9   10   11 
    ------------------------------------------------------------------------
      0   1  11  7637 8658 3548 2618 4264 8833 6517 4646 8688 7571 7116 3617 
      0   1  10  7637 3617 3548 2618 4264 8833 6517 4646 8688 7571 7116 8658 
      1   2  10  3617 7637 3548 2618 4264 8833 6517 4646 8688 7571 7116 8658 
      2   3  10  3617 3548 7637 2618 4264 8833 6517 4646 8688 7571 7116 8658 
      3   4  10  3617 3548 2618 7637 4264 8833 6517 4646 8688 7571 7116 8658 
      4   5  10  3617 3548 2618 4264 7637 8833 6517 4646 8688 7571 7116 8658 
      4   5   9  3617 3548 2618 4264 7637 7116 6517 4646 8688 7571 8833 8658 
      4   6   9  3617 3548 2618 4264 7637 7116 6517 4646 8688 7571 8833 8658 
      5   7   9  3617 3548 2618 4264 6517 7116 7637 4646 8688 7571 8833 8658 
      6   8   9  3617 3548 2618 4264 6517 4646 7637 7116 8688 7571 8833 8658 
      6   8   8  3617 3548 2618 4264 6517 4646 7637 7116 7571 8688 8833 8658 
      6   9   8  3617 3548 2618 4264 6517 4646 7637 7116 7571 8688 8833 8658


Viewing all articles
Browse latest Browse all 764

Trending Articles