c++ pop quiz QUESTION 1 Elements in two different columns of a 2D array can have
ID: 3567308 • Letter: C
Question
c++ pop quiz
QUESTION 1
Elements in two different columns of a 2D array can have different types (i.e. one column stores ints and another stores strings).
True
False
0.5 points
QUESTION 2
Given the following array
int a[] = {5, 7 , 9, 10, 15};
What is the first element compared in the array when searching for 10 with linear search?
5
7
9
10
0.5 points
QUESTION 3
Given the following array
int[] a = {5, 7 , 9, 10, 15};
What is the first element compared in the array when searching for 10 with binary search?
5
7
9
10
0.5 points
QUESTION 4
Binary Search is only guaranteed to work properly if the array being searched is sorted.
True
False
0.5 points
QUESTION 5
Given the following array:
int[] arr = { 8, 5, 7, 3, 9, 4 };
What will be the contents of arr after the first pass of the Selection Sort.
{ 8, 5, 7, 3, 9, 4 }
{ 5, 8, 7, 3, 9, 4 }
{ 3, 5, 7, 8, 9, 4 }
{ 3, 4, 5, 7, 8, 9 }
0.5 points
QUESTION 6
What is the output of the following code segment?
0.5 points
QUESTION 7
What will be the output of the following code segment:
0.5 points
QUESTION 8
The following will properly define a c-string holding "hello":
char cstr[5] = {'h', 'e', 'l', 'l', 'o'};
True
False
5
7
9
10
Explanation / Answer
1) False
2) 5
3) 9
4) True
5) { 3, 5, 7, 8, 9, 4 }
6) 2
7) Pormig
8) True
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.