If the amout of data to be stored in a stack cannot be predicted, the best data structure
to implement the stack is:
A -
linked list
B -
binary search tree
C -
unordered array
D -
None of the other answers
2-
If you want quick access to your data, a linked list will not be that helpful when the
size of the collection is ____
A -
in file
B -
unknow
C -
big
D -
small
3-
If the depth of a tree is 3 levels, then what is the Size of the Tree?
A -
8
B -
6
C -
10
D -
None of the above
4-
If you have a node pointer named head, which is pointing to a valid node, how do you
access the member variable in the node named item?
A -
head.item
B -
head->item
C -
(*head).item
D -
*head.item
5-
If there is a NodePtr named toDelete whose value points a valid node in the list, which
of the following statements would remove the node that follows toDelete from the list and return
that memory to the freestore?
A -
toDelete -> link = toDelete ->link ->link: delete toDelete->link:
If p a pointer to a node in a list (node contains value 31), provide the code that would
remove this node (31) from the doubly linked list freeing up the memory that is currently held.
(Assume next points to the right and prev points to the left). (3 lines of code)
If 8 3 12 2 9 are stored in a binary search tree, the postorder traversal of that tree would
be
A -
12 9 8 3 2
B -
2 3 9 12 8
C -
8 3 9 2 12
D -
2 3 8 9 12
8-
In a Binary Search Tree with root->element
A -
replace the root
B -
none of the other answers
C -
follow the right pointer
D -
follow the left lointer
9-
In the following code fragment, the programmer mistakenly placed a semicolon at the
end of the For statement heading. What is the result?
cout << "A";
for (count = 1; count <= 3; count++);
count << "B";
count << C;