Write a program in C++ to find the number of comparisons usingbinarySearch and the sequential search algorithm as follows:
Suppose list is an array of 1000 elements.
a. Use a random number generator to fill list.
b. Use any sorting algorithm to sort list.
c. Search list for some items as follows:
i. Use the binary search algorithm to search the list. (You mayneed to modify the algorithm given in this chapter to count thenumber of comparisons.)
ii. Use the binary search algorithm to search the list,switching to a sequential search when the size of the search listreduces to less than 15. (Use the sequential search algorithm for asorted list.)
Comments would be appreciated! Am a relatively new coder. Thankyou.