Suppose that the following function.
int sss(int x) {
if (x % 2 = = 0)
return x+1;
else
return (x – 1)*sss(x + 1);
}
Determine the output of the following statement.
println(sss(3));
A -
8
B -
10
C -
12
D -
9
2-
Suppose cursor refers to a node in a linked list (using the IntNode struct with instance
variables called data and link).
What statement changes cursor so that it refers to the next nodes?
A -
vursor = link:
B -
cursor++:
C -
cursor = cursor.link:
D -
cursor += link:
3-
Suppose cursor refers to a node in a linked list (using the IntNode struct with instance
variables called data and link). What boolean expression will be true when cursor refers to the
tail node of the list?
A -
(cursor.data = = null)
B -
(cursor.link = = null)
C -
(cursor = = null)
D -
(cursor.data = = 0.0)
4-
Suppose T is a binary tree with 14 nodes. What is the minimum possible depth of T?
A -
4
B -
5
C -
3
D -
0
5-
The following items are inserted into a AVL tree: 12, 10, 8, 5 #
A -
8
B -
5
C -
10
D -
12
6-
The address of the first element of an array is called the ____ of the array and the name
of the array is actually a ____ to this element
A -
Both a) and b)
B -
constant pointer, base address
C -
base address, constant pointer
D -
Neither a) nor b)
7-
The following items are inserted into a AVL tree: 6, 2, 4, 8, 10 #
A -
4
B -
2
C -
8
D -
10
8-
The integer range of standard ASCII codes is:
A -
-128 to +127
B -
0 to 65,535
C -
0 to 127
D -
0 to 270
9-
The Data type of a declaration statement tells how much ____ to reserve and the kind
of ____that will be stored in that ____ location
A -
Memory, Data, Memory
B -
Address, Data, Memory
C -
Both a) and b)
D -
Neither a) nor b)
10-
The dereferencing operator *:
A -
dereferences a pointer so that one is manipulating the value the pointer points to
B -
must be used to indicate the value whose address is held in a pointer
C -
allows one to use a pointer to gain indirect access to a value