Question: C++ sorting Which sort algorithm is unstable such that its runtime varies dramatically with the pattern of the data in the original array? a. bubble
C++ sorting
Which sort algorithm is unstable such that its runtime varies dramatically with the pattern of the data in the original array?
a. bubble sort
b. selection sort
c. Both bubble and selection sort
d. Neither bubble nor selection sort
Which statement is not true about the binary search algorithm presented in lecture?
a. It is the searching algorithm of choice on an ordered array.
b. It is a fast algorithm even when applied to large sorted arrays.
c. It can be applied with correct results to either a sorted or unsorted array.
d. The algorithm works correctly whether or not the target exists in the array.
Which statement is true about inserting 15 into the ordered array shown below using the most efficient algorithm?
| 10 | 20 | 30 | 40 | 50 |
|
|
0 1 2 3 4 5 6
a. Value 15 should be inserted into index 5.
b. Value 15 should be inserted into index 1, overwriting 20.
c. Value 15 should be inserted into index 0 after moving up existing elements by one position.
d. Value 15 should be inserted into index 1 after moving up existing elements by one position.
Which statement is true about removing 30 from the ordered array shown below using the most efficient algorithm?
| 10 | 20 | 30 | 40 | 50 |
|
|
0 1 2 3 4 5 6
a. A dummy value like -1 should be written into index 2.
b. Value 50 should be inserted into index 2, overwriting 30.
c. Values in indexes 3 to 4 should be moved down by one position.
Which statement is true about the 2D array declared as: int table[5][10];
a. Given an integer uses 4 bytes, this array is allocated 200 bytes.
b. In the mental model of this data structure there are 5 rows and 10 columns.
c. Internally, the data for this 2D array is stored by row.
d. Both choices a) and b) are true.
e. All choices a), b), and c) are true.
Given the 2D array declaration: int table[5][10]; which function heading would be appropriate for a function which is passed the 2D array and the number of rows and performs some computation upon the values in those rows?
a. void f (int a[5][10]);
b. void f (int * * a, int rows);
c. void f (int a[ ][10], int rows);
d. void f (int a[ ][ ], int rows, int columns);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
