Question
Java Programming: O(N) Searching on String Concept Paul and Prue have asked Noel and Sandy to help them sort their list of Technical Challenges into
Java Programming: O(N) Searching on String
Concept
Paul and Prue have asked Noel and Sandy to help them sort their list of Technical Challenges into Alphabetical Order. As known, 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)
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. (Make sure you choose carefully, and explain why you chose the Collection object you did in the comments)
- Process the words using a Radix sort algorithm. The algorithm mus account for words of differing lengths
- Display the result of each iteration of your Radix algorithm
Sample Run
"Iterating on index: 19 chocolate babka coconut macaroons iced buns matcha milk crepe cake jam and custard doughnuts rainbow colored bagel
Iterating on index: 18 chocolate babka coconut macaroons iced buns rainbow colored bagel matcha milk crepe cake jam and custard doughnuts
Iterating on index: 17 chocolate babka coconut macaroons iced buns matcha milk crepe cake rainbow colored bagel jam and custard doughnuts
Iterating on index: 16 chocolate babka iced buns rainbow colored bagel jam and custard doughnuts matcha milk crepe cake coconut macaroons
Iterating on index: 15 chocolate babka iced buns jam and custard doughnuts rainbow colored bagel coconut macaroons matcha milk crepe cake
Iterating on index: 14 iced buns chocolate babka jam and custard doughnuts rainbow colored bagel matcha milk crepe cake coconut macaroons
Iterating on index: 13 iced buns chocolate babka coconut macaroons jam and custard doughnuts rainbow colored bagel matcha milk crepe cake
Iterating on index: 12 iced buns jam and custard doughnuts chocolate babka matcha milk crepe cake coconut macaroons rainbow colored bagel Iterating on index: 11 iced buns matcha milk crepe cake chocolate babka coconut macaroons rainbow colored bagel jam and custard doughnuts Iterating on index: 10 iced buns chocolate babka coconut macaroons matcha milk crepe cake r rainbow colored bagel jam and custard doughnuts Iterating on index: 9 iced buns chocolate babka coconut macaroons matcha milk crepe cake rainbow colored bagel jam and custard doughnuts
Iterating on index: 8 rainbow colored bagel jam and custard doughnuts chocolate babka matcha milk crepe cake coconut macaroons iced buns Iterating on index: 7 rainbow colored bagel jam and custard doughnuts coconut macaroons matcha milk crepe cake iced buns chocolate babka Iterating on index: 6 matcha milk crepe cake chocolate babka jam and custard doughnuts coconut macaroons iced buns rainbow colored bagel Iterating on index: 5 matcha milk crepe cake iced buns chocolate babka jam and custard doughnuts rainbow colored bagel coconut macaroons Iterating on index: 4 iced buns jam and custard doughnuts rainbow colored bagel matcha milk crepe cake coconut macaroons chocolate babka Iterating on index: 3 jam and custard doughnuts matcha milk crepe cake chocolate babka iced buns rainbow colored bagel coconut macaroons Iterating on index: 2 coconut macaroons iced buns rainbow colored bagel jam and custard doughnuts chocolate babka matcha milk crepe cake Iterating on index: 1 rainbow colored bagel jam and custard doughnuts matcha milk crepe cake iced buns chocolate babka coconut macaroons Iterating on index: 0 chocolate babka coconut macaroons iced buns jam and custard doughnuts matcha milk crepe cake rainbow colored bagel
"Done..."
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started