C++ Programming banner
Fourth EditionD.S. Malik
Chapters:

Chapter 19

Self-Test

INSTRUCTIONS: Answer each question below. Click the 'Grade Test' button to receive a graded study guide. You will not get a grade until all questions are answered.

  1. A ____ array can solve the problem of queue overflow in the rear.
    1. A: circular
    2. B: dynamic
    3. C: static
    4. D: parallel
  2. The ____ of the queue is accessed whenever an element is deleted from the queue.
    1. A: back
    2. B: front
    3. C: middle
    4. D: None of the above
  3. A linked queue is empty if _____ is NULL .
    1. A:  queueFront->link
    2. B:  queueRear->link
    3. C:  queueFront
    4. D:  queueRear
  4. The initializeStack stack function ____.
    1. A: is called by the constructor
    2. B: sets the size of the stack
    3. C: calls the constructor
    4. D: initializes the stack to an empty state
  5. Many compilers translate arithmetic expressions into ____ notation and then translate this expression into machine code.
    1. A: postfix
    2. B: Polish
    3. C: infix
    4. D: prefix
  6. Computer ____ is a technique in which one system models the behavior of another system.
    1. A: cloning
    2. B: queuing
    3. C: linkage
    4. D: simulation
  7. Charles L. Hamblin proposed a scheme in which the operators follow the operands, resulting in the _____ notation.
    1. A: Reverse Polish
    2. B: Pascal Case
    3. C: prefix
    4. D: Reverse Curve
  8. A stack is a list of ____ elements.
    1. A: primitive
    2. B: immutable
    3. C: heterogeneous
    4. D: homogeneous
  9. A(n) _____ expression is one in which the operators are written between the operands.
    1. A: Polish
    2. B: postfix
    3. C: prefix
    4. D: infix
  10. In a time-driven simulation, the clock is implemented as a ____.
    1. A: class
    2. B: counter variable
    3. C: list
    4. D: queue
  11. If you try to add a new element to a full stack, the resulting condition is called a(n) ____.
    1. A: underflow
    2. B: simulation error
    3. C: circular condition
    4. D: overflow
  12. A stack element can be accessed ____.
    1. A: only at the top of the stack
    2. B: only at the bottom of the stack
    3. C: either at the top or bottom of the stack
    4. D: from anywhere in the stack
  13. A queue is a(n) ____ data structure.
    1. A: FIFO
    2. B: immutable
    3. C: LIFO
    4. D: primitive
  14. If you try to remove an item from an empty stack, the resulting condition is called a(n) ____.
    1. A: underflow
    2. B: simulation error
    3. C: circular condition
    4. D: overflow
  15. In the queuing system simulation presented in this chapter, the list of servers is stored in a(n) ____.
    1. A: dynamic array
    2. B: linked list
    3. C: linked queue
    4. D: array-based queue
  16. The isEmptyStack function ____.
    1. A: initializes a stack to an empty state
    2. B: sets the size of a stack
    3. C: determines whether an item can be removed from a stack
    4. D: determines whether an item can be added to a stack
  17. The linked queue implementation in this chapter uses _____ pointers to maintain the queue.
    1. A: one
    2. B: two
    3. C: three
    4. D: four
  18. The stack is a(n) ____ data structure.
    1. A: FIFO
    2. B: circular
    3. C: LIFO
    4. D: static
  19. The addition and deletion of elements in a stack only occurs at one end, called the ____ of the stack.
    1. A: bottom
    2. B: top
    3. C: front
    4. D: back
  20. The isFullQueue function ____.
    1. A: returns an int value
    2. B: always returns the value false in a linked queue
    3. C: always returns the value false in an array-based queue
    4. D: is not implemented in a linked queue