Chapter 9 Questions
What List action does this depict?
a. insert a new node
b. get the value stored at a node
c. remove a node from the chain
d. get the value stored at a node
21. In the link based implementation of the ADT List, what method does the destructor call?
a. remove
b. insert
c. isEmpty
d. clear
22. Given the following pseudocode logic:
if ( the insertion position is 1 )
Add the new node to the beginning of the chain
else
Ignore the first node and add the new node to the rest of the chain
What does this describe?
a. recursive addition of a node to the list
b. iterative addition of a node to the list
c. addition of a node to the beginning of the list
d. adding a node to the end of the list
23. In an array based implementation of the ADT List, what is a characteristic of the time required to access any
particular element in the list?
a. you have no way of knowing how long it will take
b. the time required is a constant
c. the time required is a function of the size of the list
d. It is of order O(n2)
24. When calling the insert or remove methods, what is an advantage for the link-based implementation of the
ADT List?
a. searching for that position is quicker
b. takes less memory
c. no need to shift data
d. easier to understand
25. When calling the insert or remove methods, what is an disadvantage for the link-based implementation of
the ADT List?