The sequence's insert member function normally puts a new item
before the current item. What should insert do if there is no
current item?
Question 6 options:
|
A)
|
The insert precondition is violated. |
|
|
B)
|
The new item is put at the beginning of the sequence. |
|
|
C)
|
The new item is put at the end of the sequence. |
|
|
|
Suppose the bag and sequence are both implemented with a
fixed-size array as in Chapter 3. What is the difference between
the private member variables of the bag and the private member
variables of the sequence?
Question 7 options:
|
A)
|
The bag has an extra array of Items. |
|
|
B)
|
The bag has one extra size_t variable. |
|
|
C)
|
The sequence has an extra array of Items. |
|
|
D)
|
The sequence has one extra size_t variable. |
|
Suppose that the bag is implemented with a fixed-size array.
Which of these operations are likely to have a constant worst-case
time?
Question 8 options:
|
|
|
|
|
|
|
D)
|
ALL of (A), (B), and (C) are likely to have a constant
worst-case time. |
|
Which of the following C++ features are used by the bag class of
Chapter 3?
Question 10 options:
|
A)
|
static member constant |
|
|
B)
|
short-circuit evaluation |
|
|
C)
|
The C++ Standard Library |
|
|
|