Question: Write a code in C + + Store a list of 1 0 or so random ( unalphabetized ) strings in a text file. For
Write a code in C
Store a list of or so random unalphabetized strings in a text file. For example, you can use a website such as the following to generate random names first and last, by default:Create an object of our custom static array class see the repository for the class definition and read the names in using an ifstream.
Note: if you would like to write your own custom static array class definition, you are welcome encouraged to do soSort the list of names using our sorting algorithm. Again, you are welcome to write your own more efficient? sorting algorithm. If you would like to write your own, you might be interested in looking into the quicksort or mergesort algorithms.
A substantial point of this instruction is to get you familiar with a sorting algorithm, so I would prefer you not to use the "black box" std::sort from the header file.
Finally, prompt the user for a name to search for, and search for the name using binary search. If inclined, you can also search for the name using the sequential search algorithm and "benchmark" the two algorithms.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
