Comment on page Least Significant Digit Radix Sort -- Using Count Sort
Notice in the above picture that we had a completely random input of numbers 22, 34, 41, etc. Then in the second box, we had sorted by right most digit, so 41, 41, 31 would come first as 1 is the lowest rightmost digit. Next would come 32, 22, 12, as 2 is the second least rightmost digit. Notice that we still have to take care of sorting 32, 22, and 12 which is why we move to the second right most digit in our last box which has everything sorted.
What is the runtime of LSD sort?
• $\Theta(WN+WR)$
• $N$
: Number of items,
$R$
: size of alphabet,
$W$
: Width of each item in # digits Non-equal Key Lengths
{"ft_lang_label":"__label__en","ft_lang_prob":0.93700475,"math_prob":0.9971742,"size":683,"snap":"2023-40-2023-50","text_gpt3_token_len":189,"char_repetition_ratio":0.122238584,"word_repetition_ratio":0.0,"special_character_ratio":0.284041,"punctuation_ratio":0.1446541,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98784477,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,1,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-05T11:09:41Z\",\"WARC-Record-ID\":\"<urn:uuid:ed6f1742-bb25-46cd-99e5-a599d6c28d6d>\",\"Content-Length\":\"330621\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5020e0e5-2759-4f41-b92f-fc926a3d8376>\",\"WARC-Concurrent-To\":\"<urn:uuid:8026bf69-4667-44e5-a99a-a6280295195f>\",\"WARC-IP-Address\":\"172.64.147.209\",\"WARC-Target-URI\":\"https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.2-lsd-radix-sort\",\"WARC-Payload-Digest\":\"sha1:EDPL3UWCPG4M7DJH6GCR5KTFA77MF64L\",\"WARC-Block-Digest\":\"sha1:ICJ727ERLCH6PMB23UPJ4UFCMSS4GDLC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100551.17_warc_CC-MAIN-20231205105136-20231205135136-00291.warc.gz\"}"}