You use a structure to declare an instance of data group
B -
All of the above
C -
You use a structure to access parts of a data
D -
You use a structure to group together related data
2-
Why is the constructor of the QueueLinkedList class empty?
A -
because initialization of data members of the QueueLinkedList class is performed by the constructor of the LinkedList class.
B -
because initialization of data members of the QueueLinkedList class is performed by the destructor of the LinkedList class.
C -
because initialization of data members of the LinkedList class is performed by the destructor of the LinkedList class.
D -
because initialization of data members of the LinkedList class is performed by the constructor of the LinkedList class.
3-
You want to remove 12 from a BST. After that, the node on the right of node 5 is:
A -
19
B -
25
C -
Null
D -
21
4-
You have random access in O(1) to every element of an _______
A -
queue
B -
stack
C -
linked list
D -
array
5-
You are given a stack that holds data of type char, operations 1 and 2 where 1=Push
and 2=Push and the input sequence as abcdef. What are the contents of the stack after the
operation sequence: 11121221122.
(Note: First element is a the bottom).
A -
a
B -
db
C -
ab
D -
The stack underflows
6-
You are given a sorted list. Which method is likely to give the best pefromance in
sorting the numbers in the same order as they are already sorted:
A -
Selection Sort
B -
Move list to Binary Tree
C -
All methods have the same performance
D -
Insertion Sort
7-
The destructor is responsible for allocating all the memory that was allocated for the
linked list.
A -
None of the above
B -
Neither a) nor b)
C -
True
D -
False
8-
The Data type of a declaration statement tells how much ____ to reserve and the kind
of ____that will be stored in that ____ location
A -
Address, Data, Memory
B -
Memory, Data, Memory
C -
Neither a) nor b)
D -
Both a) and b)
9-
Suppose we have the following declarations:
int x =0, y = 2; &z = y;
int * p = &z;
Which of the following statements is illegal?
A -
x = *p:
B -
z = *p:
C -
* p = y:
D -
* p = &z:
10-
Recursion has a serious disadvantage of using large amount of memory. Moreover, for
most programming languages, recursion use stack store states of all currently active recursive
calls. The size of a stack may be quite large, but limited. Therefore too deep recursion can result
in ____