Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use python or Java to write a code. Problem 4. (30 points) Assume you have a list of names that you want to sort in
Use python or Java to write a code.
Problem 4. (30 points) Assume you have a list of names that you want to sort in alphabetical order. Use bucket sort to solve this problem (i.e. the program should run in average case O(n)). However, use bucket sort recursively to ensure that each of the final buckets that are sorted via insertion sort contain no more than 10 elementsames. The way you would do this is when sorting each bucket, if there are more than 10 elementsames in the bucket then you would create sub-buckets and run a mini-bucket sort on only the elements in this large bucket. You may assume there are no spaces in the names and only contain normal English alphabet characters. Also only the first letter of names will be capitalized. Sample output.txt (sorted name array separated by spaces (no space after final name)): Candy Mahesh Rishi Svetovid Sample input.txt (unsorted names separated by spaces (no space after final name)): Svetovid Candy Rishi MaheshStep 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