Question: Topic: Searching on String Program Introduction Paul and Prue have asked Noel and Sandy to help them sort their list of Technical Challenges into Alphabetical
Topic: Searching on String Program
Introduction
Paul and Prue have asked Noel and Sandy to help them sort their list of Technical Challenges into Alphabetical Order.
Remember, the Radix sort is a O(n) algorithm for sorting numbers. This sort can be extended to strings with a little bit of work.
The list of words may:
- contain more than 20 characters, but you can ignore any characters past the 20th for sorting, but must display the whole word after sorting
- be converted to lowercase and left in lowercase (i.e. not need to convert back to the original case after sorting)
- contain only letters and spaces (no numbers or other special characters)
Assignment Description
The program will need to perform the following tasks:
- Load a list of words from a file
- Create the needed buckets, each bucket being a Collection object.
- Process the words using the Radix sort algorithm from the book as a guide, you will need to modify the algorithm to account for words of differing lengths
- Display the result of each iteration of your Radix algorithm
- Be careful when choosing your Collection objects, some dont guarantee to maintain the order that items are added to them
Sample Run:
Iterating on index: 19
chocolate babka coconut macaroons iced buns
matcha mill crepe cake jam and custard doughnuts rainbow coloured bagel
Iterating on index: 18
chocolate babka coconut macaroons iced buns
rainbow coloured bagel matcha mill crepe cake jam and custard doughnuts
Iterating on index: 17
chocolate babka coconut macaroons iced buns
matcha mill crepe cake rainbow coloured bagel jam and custard doughnuts
Iterating on index: 16
chocolate babka iced buns
rainbow coloured bagel jam and custard doughnuts matcha mill crepe cake coconut macaroons
Iterating on index: 15
chocolate babka iced buns
jam and custard doughnuts rainbow coloured bagel coconut macaroons matcha mill crepe cake
Iterating on index: 14
iced buns chocolate babka
jam and custard doughnuts
rainbow coloured bagel matcha mill crepe cake coconut macaroons
Iterating on index: 13
iced buns chocolate babka coconut macaroons
jam and custard doughnuts rainbow coloured bagel matcha mill crepe cake
Iterating on index: 12
iced buns
jam and custard doughnuts chocolate babka
matcha mill crepe cake coconut macaroons rainbow coloured bagel
Iterating on index: 11
iced buns
matcha mill crepe cake chocolate babka coconut macaroons rainbow coloured bagel
jam and custard doughnuts
Iterating on index: 10
iced buns chocolate babka coconut macaroons
matcha mill crepe cake rainbow coloured bagel jam and custard doughnuts
Iterating on index: 9
iced buns chocolate babka coconut macaroons
matcha mill crepe cake rainbow coloured bagel jam and custard doughnuts
Iterating on index: 8
rainbow coloured bagel jam and custard doughnuts chocolate babka
matcha mill crepe cake coconut macaroons iced buns
Iterating on index: 7
rainbow coloured bagel jam and custard doughnuts coconut macaroons matcha mill crepe cake iced buns
chocolate babka
Iterating on index: 6
matcha mill crepe cake chocolate babka
jam and custard doughnuts coconut macaroons
iced buns
rainbow coloured bagel
Iterating on index: 5
matcha mill crepe cake iced buns
chocolate babka
jam and custard doughnuts rainbow coloured bagel coconut macaroons
Iterating on index: 4
iced buns
jam and custard doughnuts rainbow coloured bagel matcha mill crepe cake coconut macaroons chocolate babka
Iterating on index: 3
jam and custard doughnuts matcha mill crepe cake chocolate babka
iced buns
rainbow coloured bagel coconut macaroons
Iterating on index: 2
coconut macaroons iced buns
rainbow coloured bagel jam and custard doughnuts chocolate babka
matcha mill crepe cake
Iterating on index: 1
rainbow coloured bagel jam and custard doughnuts matcha mill crepe cake iced buns
chocolate babka coconut macaroons
Iterating on index: 0
chocolate babka coconut macaroons iced buns
jam and custard doughnuts matcha mill crepe cake rainbow coloured bagel
Done...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
