Chapter 18 Flashcards
True or false:
The bottom element of the stack is the last element added to the stack.
False
True or false:
In the array representation of a stack, if a value called stackTop indicates the number of elements in the stack,
then stackTop-1 points to the top item of the stack.
True
True or false:
If you try to add a new item to a full stack, the resulting condition is called an outflow.
False
True or false:
In the linked implementation of stacks, the memory to store the stack elements is allocated statically.
False
True or false:
The default constructor for the linked implementation of a stack initializes the stack to an empty state when a stack
object is declared.
True
True or false:
Postfix notation requires the use of parentheses to enforce operator precedence.
False
True or false:
The infix expression
(a + b) * (c - d / e) + f
is equivalent to the postfix expression
ab + cde /-* f +
True
True or false:
The expression a + b is the same in both infix notation and postfix notation.
False
True or false:
A queue is a First In First Out(FIFO) data structure.
True
A(n) ____ is a list of homogenous elements in which the addition and deletion of elements occurs only at one end.
stack
The addition and deletion of elements of a stack occurs only at the ____ of the stack.
Top
The ____ element of the stack is the last element added to the stack.
top
A stack is a(n) ____ data structure.
LIFO(Last In First Out)
You can perform the add operation, called ____, to add an element onto the stack.
push
You can perform the operation ____ to remove the top element from the stack.
pop
A stack can be implemented as either a(n) ____ or a linked structure.
array