Question
Sorting and Search (implement using Java) Randomly generate a list of Strings. Each string is no longer than 15 letters. Define a method/function which take
Sorting and Search (implement using Java)
Randomly generate a list of Strings. Each string is no longer than 15 letters. Define a method/function which take a number from the user and generates that number of Strings.
Sort the List of Strings using a Selection Sort algorithm
Sort the List of Strings using a Bubble Sort algorithm
Then prepare 100 strings: 50 of them are randomly generated and the other 50 are randomly chose from the list on Strings. Implement a brute-force algorithm to search these 100 Strings in the the list of Strings and implement a recursive algorithm that takes O(logn) recursive calls.
Test each on a list of 100 and 1000 and compare the time spent
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