The isFull ( ) member method is called within the enqueue process to determine
A -
None of the above
B -
if there is room to place another item in the queue
C -
if there is an item in the queue to be removed
D -
if there is an iem the queue to be locked
2-
The following function.
int W(int x) {
if ((x % 3 = = 0) && (x > 0))
return 1 + W(4 + W(x- 3));
else if (x % 2 = = 0)
return W(x + 1);
return x + 2;
}
What value would the call W(2) return?
A -
7
B -
10
C -
6
D -
8
3-
The following function.
public static int ttt(int x, int y) {
if (x % y = = 0)
return x/y + 2;
else
return x – ttt(y, x + 1);
}
Determine the output of the following statement.
Println(ttt(7, 3));
A -
6
B -
2
C -
15
D -
8
4-
The destructor is responsible for allocating all the memory that was allocated for the
linked list.
A -
True
B -
False
C -
Neither a) nor b)
D -
None of the above
5-
The following function.
int kkk(int x){
if((x % 3 = = 0) && (x > 0))
return 1 + kkk(4 + kkk(x – 3));
else if(x % 2 = = 0)
return kkk(x + 1);
return x + 2;
}
What value would the call kkk(2) return?
A -
10
B -
6
C -
None of the others answers
D -
8
6-
The following function.
int add(int x, int y) {
if (x*y = = 0)
return x + y;
else
return (x – y) + add(x + 1, y-1);
}
Determine the output of the following statement.
cout<
A -
6
B -
8
C -
None of the others answers
D -
10
7-
The meaning of the insertFirst(e) method of the List ADT is
A -
replace the element of the Node at the front of the List with e
B -
replace the node at the front of the List with Node e
C -
add the new Node e to the front of the List
D -
add a new Node with data element e at the front of the List
8-
The variable varFirst is a LinkNode object of a linked list. varFirst refferenced to the
first node. You want to build function to check this list is empty
/* @returns true if this list is empty. */
Boolean isEmpty ( )
{
Return varFirst = = ______;
}
The missing word is:
A -
nothing
B -
varFirst.Next
C -
new LinkNode();
D -
NULL
9-
The last member function is ____
A -
displayNode()
B -
destroyList()
C -
tNode()
D -
appendNode()
10-
The ____ function retrieves the value of the size member of the LinkedList class