Question: Task 1: Create an employee Class that encapsulates the concept of an employee. The attributes of an employee are: - id o a random integer
Task 1: Create an employee Class that encapsulates the concept of an employee. The attributes of an employee are: - id o a random integer in the range 0 to 99999999 (i.e. like a social security number) o we will ignore the fact that we may get duplicate id numbers - name o a String of a random length between 5 and 10 characters (inclusive) made up of a random set of lower case characters - dept o a random integer in the range 1 to 5 (inclusive) - hired o a random integer in the range 1995 to 2015 (inclusive) You may also want to create a factory method that allows you to generate a new employee with random attributes. Task 2: Create a class named Sort that will act as a container for the following generic array sorting algorithms: - simpleBubbleSort o a brute force bubble sort that just uses a pair of nested loops o this needs to be a generic bubble sort o this needs to be a stable sort - mergeSort o this should be the recursive mergeSort described in the textbook - quickSort o this should be the recursive quickSort described in the textbook o you may have to modify this code - multikeySort o this should be a generic sort o the multikeySort should be able to support between two and four keys o the first parameter in the parameter list should be the array being sorted. o the remaining parameters in the parameter list should be the keys (Comparators), ordered left to right from most significant to least significant. Task 3: - Create a client class that o Generates an array of 1,000,000 employees o Sort the employee array on name using the merge sort o Sort the employee array on dept using the quick sort o Sort the employee array on id using the bubble sort Reduce the array size to 100,000 for the bubble sort. A list of 1,000,000 employees can take 6 plus hours to sort with the bubble sort. o Sort the employee array using the multikey sort so that All employees are sorted by department Within a department grouping all the employees are sorted by hire date Within a department and hire date grouping all the employees are sorted by their name - Since the list of employees is long o You will not print out the unsorted or sorted employee lists, instead, o Print out the time that it takes to run each sort o Suggestion: Make a test run of 1,000 employees and inspect the results to make sure that they are correctly ordered before attempting the full test. - Caution o Make sure that you are passing the same unsorted list to each of your sort routines. o If you follow the textbook code the container that is passed in as a parameter is the container that is sorted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
