# Part A of OPTION 2: Radix-Sort The purpose of Part A is to implem...

## Question

Part A of OPTION 2: Radix-Sort
The purpose of Part A is to implement a radix-sort based algorithm for sorting 32-bit unsigned integers. A 32-bit unsigned integer can be viewed as an 1-digit radix-232 − 1 integer, or a 2-digit radix-65536 integer, or a 4-digit radix-256 integer. For JAVA implementations one may assume that the input is a 31-bit non-negative integer.
void rdx_sort (unsigned int *keys, int n,
rdx_sort (int[] keys, int n,
keys
n
// C or C++
// Java
: is a pointer to the input array of unsigned int data type.
: is the dimension (number of elements) of the array.
3. otherwise, if n ≥ mradix , your algorithm should behave like CountSort,

Remark. Note the order of the if-otherwise statement above. If n = 10000 and mradix = 256, case 1 applies, even if case 3 is also applicable.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <math.h>

using namespace std;

void rdx_sort (unsigned int *keys, int n, unsigned int mradix);

int main()
{
int n = 100;
unsigned int *keys;
keys = new unsigned int[n];
printf("Original List:\n");
for(int i = 0; i < n; i++)
{
keys[i] = rand();
keys[i] <<= 16;
keys[i] += rand();
keys[i] <<= 1;
keys[i] += rand()%2;...

By purchasing this solution you'll be able to access the following files:
Solution.cpp.

# 50% discount

Hours
Minutes
Seconds
\$40.00 \$20.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.