Question: Note: Queson 1 and 2 will be discussed in the class with correct answers 3. Write a c++ version of the sequenal search algorithm that
Note: Queson 1 and 2 will be discussed in the class with correct answers\ 3. Write a c++ version of the sequenal search algorithm that can be used to search a sorted list. Hint: You\ can generate a list with rand() funcon, then use the sorng algorithm given in the class to sort the\ array. Aer the list is sorted, then call the funcon that you wrote to do the sequenal search. The\ size of the list should be a random number ranging from 1 to 20. The elements of the list should be\ random numbers ranging from -100 to +700.\ 4. Suppose that the elements of a list are in descending order and they need to be put in ascending\ order. Write a C++ funcon that takes as input an array of items in descending order and the number\ of elements in the array. The funcon rearranges the elements of the array in ascending order. Your\ funcon must not incorporate any sorng algorithms, that is, no item comparisons should take\ place. Hint: Again, create a random list as above. The use the modified sorng algorithm to sort it in\ a descending order. Then call your funcon to reverse the order to the ascending order.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
