Select result after running code segment?
int grade1 = 75, grade2 = 85, grade3 = 95;
if (grade1 <= grade2 && grade3 <= grade2)
cout << "A";
else
if (grade1 <= grade2 || grade3 <= grade2)
cout <<"B";
else
cout << "C";
A -
B
B -
None of other answers
C -
A
D -
C
2-
Select the one FALSE statement about binary trees:
A -
Every node has at most two children
B -
Every non-root node has exactly one parent
C -
Every binary tree has at least one node
D -
Every non-empty tree has exactly one root node
3-
Show the array as it is sorted in ascending order, step by step ________
3, 2, 7, 9, 1, 6
1, 2, 7, 9, 3, 6
1, 2, 3, 9, 7, 6
1, 2, 3, 6, 7, 9
A -
by Bubble sort
B -
by Selection sort
C -
by Quick sort
D -
by Insertion sort
4-
Show the array as it is sorted in ascending order, step by step ________
3, 2, 7, 9, 1, 6
3, 3, 7, 9, 1, 6
1, 2, 3, 7, 9, 6
1, 2, 3, 6, 7, 9
A -
by Bubble sort
B -
by Insertion sort
C -
by Selection sort
D -
by Quick sort
5-
Show the array as it is sorted in ascending order, step by step ________
12, 2, 8, 5, 1, 6, 4, 15
4, 2, 8, 5, 1, 6, 12, 15
4, 2, 1, 5, 8, 6, 12, 5
1, 2, 4, 5, 6, 8, 12, 15
A -
by Selection sort
B -
by Bubble sort
C -
by Quick sort
D -
by Insertion sort
6-
Show the array as it is sorted in ascending order, step by step ________
3, 2, 7, 9, 1, 6
2, 3, 7, 9, 1, 6
1, 3, 7, 9, 2, 6
1, 2, 7, 9, 3, 6
1, 2, 3, 9, 7, 6
1, 2, 3, 7, 9, 6
1, 2, 3, 6, 9, 7
1, 2,3 , 6, 7, 9
A -
by Insertion sort
B -
by Bubble sort
C -
by interchange sort
D -
by Selection sort
7-
Show the array as it is sorted in ascending order, step by step ________
3, 2, 7, 9, 1, 6
3, 2, 7, 1, 9, 6
3, 2, 1, 7, 9, 6
3, 1, 2, 7, 9, 6
1, 3, 2, 7, 9, 6
1, 3, 2, 7, 6, 9
1, 3, 2, 6, 7, 9
1, 2, 3 , 6, 7, 9
A -
by Quick sort
B -
by Bubble sort
C -
by Insertion sort
D -
by Selection sort
8-
Suppose we have the following declarations:
int x =0, y = 2; &z = y;
int * p = &z;
Which of the following statements is illegal?
A -
* p = &z:
B -
* p = y:
C -
z = *p:
D -
x = *p:
9-
Suppose we have the following declarations:
const int x = 1;
int y = 2;
int * p = &y;
const int * q = &x;
Which one of the following statement is illegal?
A -
*p = 3:
B -
q = &y:
C -
q = p:
D -
p = q:
10-
Suppose we have the following declarations:
int a [ ] = {1, 2, 3, 4};
int b [ ] = {0, 3, 6, 9};
int * p = a, *q;
Which of the following assigments is illegal?