Starting from:

$30

CSC 220 Algorithms Homework 2 Solved

Homework 2 of CSC 220 Algorithms

In this your second project you write a function int sort(int A[], int n)

that takes one array of length n and sorts it. However, n is of the order of ten millions, so you need to use radixsort to get the sorting done fast. Fast here means in the range of seconds.

The numbers are all less than 232; you need to do two rounds of radixsort for the lower and upper 16 bit of the number. For an integer b you can find the lower 16 bit by b & 0xFFFF and the upper 16 bit by (b16) & 0xFFFF. Read up about bit operations and hexadecimal number in C and C++.

Include in your homework your name, the date, and the class, in a comment line. Submit your homework, with the homework number and the class in the subject line. Do not share code with other students.

1

More products