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. 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
  2. In an array-based stack, the index of the top element in the stack is ____.
    1. A:  stackTop
    2. B:  stackTop-1
    3. C:  maxStackSize
    4. D:  0
  3. A queue is a(n) ____ data structure.
    1. A: FIFO
    2. B: immutable
    3. C: LIFO
    4. D: primitive
  4. In an array-based implementation of a queue, queueRear is initialized to ____.
    1. A:  maxQueueSize
    2. B:  maxQueueSize - 1
    3. C:  queueFront
    4. D:  maxQueueSize + 1
  5. In a linked queue, the definition of the destructor is similar to the definition of the ____ function.
    1. A:  deleteQueue
    2. B: copy constructor
    3. C: constructor
    4. D:  initializeQueue
  6. The stack is a(n) ____ data structure.
    1. A: FIFO
    2. B: circular
    3. C: LIFO
    4. D: static
  7. The ____ operation of a stack removes the top element of the stack.
    1. A:  back
    2. B:  pop
    3. C:  top
    4. D:  push
  8. In a circular array-based implementation of a queue. the rear of the queue is assigned the position ____.
    1. A:  maxQueueSize
    2. B:  queueRear + 1
    3. C:  (queueRear + 1) % maxQueueSize
    4. D:  queueRear % maxQueueSize + 1
  9. A(n) _____ consists of servers and queues of objects waiting to be served.
    1. A: customer transaction
    2. B: linked simulation system
    3. C: queuing system
    4. D: time-driven simulation
  10. 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
  11. In a stack implemented with a dynamic array, which of the following functions must be provided?
    1. A: overloaded assignment operator
    2. B: destructor
    3. C: copy constructor
    4. D: all of the above
  12. The deleteQueue function if a linked queue has a return value of ____.
    1. A:  void
    2. B:  Type
    3. C:  int
    4. D:  linkedQueueType<Type>
  13. Which of the following is the general loop condition to process the information of a stack?
    1. A:  while (stackTop == current)
    2. B:  while (stackTop != -1)
    3. C:  while (stack.isFull())
    4. D:  while (!stack.isEmptyStack())
  14. It is best to use a(n) ____ to print a list backwards.
    1. A: linked implementation of a queue
    2. B: array-based implementation of a stack
    3. C: linked implementation of a stack
    4. D: array-based implementation of a queue
  15. The isFullStack function ____.
    1. A: determines whether the stack is full
    2. B: determines whether the stack is empty
    3. C: loads items onto the stack
    4. D: removes items from the stack
  16. In a time-driven simulation, the clock is implemented as a ____.
    1. A: class
    2. B: counter variable
    3. C: list
    4. D: queue
  17. In the serverListType class presented in this chapter, the value of ____ indicates that all the servers are busy.
    1. A:  -1
    2. B:  0
    3. C:  NULL
    4. D:  false
  18. A linked implementation of a queue is similar to a(n) ____.
    1. A: array-based implementation of a list
    2. B: array-based implementation of a stack
    3. C: linked list implementation created in a backward manner
    4. D: linked list implementation created in a forward manner
  19. In a queue, elements are deleted from the end called the ____.
    1. A: back
    2. B: rear
    3. C: top
    4. D: front
  20. 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