标签:element val list creat seq The dig nts sub
To illustrate the radix sort algorithm we will sort the sequence S0 = {32, 100, 11, 554, 626, 122, 87, 963, 265, 108, 9}. We start by distributing elements of S0 by the value of 0-place digit (the one‘s place):
Stitch the bucket lists to create S1 = {100, 11, 32, 122, 963, 554, 265, 626, 87, 108, 9}. Distribute elements of S1 by the value of 1-place digit (the ten‘s place):
Stitch the bucket lists to create S2 = {100, 108, 9, 11, 122, 626, 32, 554, 963, 265, 87}. Distribute elements of S2 by the value of 2-place digit (the hundred‘s place):
Stitch the bucket lists to create S3 = {9, 11, 32, 87, 100, 108, 122, 265, 554, 626, 963}. The list is sorted.
标签:element val list creat seq The dig nts sub
原文地址:https://www.cnblogs.com/JasperZhao/p/12812204.html