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
Get step-by-step solutions from verified subject matter experts
