Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long nibble_sort_word2(unsigned long arg)
- {
- int i, j;
- unsigned long counter[16] = {0};
- for (i = 0; i < 16; i++) {
- counter[read_nibble(arg, i)]++;
- }
- // Loop through all the buckets
- for (i = 0, j = 0; i < 16; i++) {
- while (counter[i]--) {
- write_nibble(&arg, j++, i);
- }
- }
- return arg;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement