Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions