Question
6 C++ Questions: 19. Assuming an int is size 4 bytes, what is the size in memoryof the below array: int cards[10] = {7, 4,
6 C++ Questions:
19. Assuming an int is size 4 bytes, what is the size in memoryof the below array:
int cards[10] = {7, 4, 7, 5, 7};
20. In the array from question 19, what is the value of thebelow elements:
cards[1];cards[8];
Assume you have an array with 128 integers which is sorted fromlowest to highest.
21a. You are searching for a value which is contained in the arrayusing the binary search algorithm. What is the minimum number ofcomparisons it will take?
21b. You are searching for a value which is contained in the arrayusing the linear search algorithm. What is the maximum number ofcomparisons it will take?
22. True/False: in order to use the linear search algorithm onan array, the array must be sorted
23. True/False: a bubble sort on an integer array is guaranteedto do at least one swap.
24. Write a function which takes an array of ints and size ofarray as parameters, and returns the maximum value in thearray. You do not need to demonstrate calling this functionfrom main(). It must have the following signature:
int findMax(const int array[], int size);
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