WorksheetsWorksheet: Arrays, Stacks, Infix/Postfix (Grade 13)
Total questions: 60
Worksheet time: 30mins
Array stores elements in
random memory
contiguous memory
linked memory
stack
Index of first element is
0
1
−1
MAX
Insertion shifts elements
left
right
up
none
Deletion shifts elements
left
right
up
none
Array overflow occurs when
n < MAX
n == MAX
n > 0
n = 0
Array underflow occurs when
n = 0
n > 0
n < MAX
n = MAX
Array size is
fixed
dynamic
infinite
flexible
Which operation displays elements?
insert
delete
display
create
Array is a
linear structure
non-linear structure
tree
graph
Maximum size is defined by
n
MAX
size
index
Stack follows
FIFO
LIFO
FILO
none
Stack insertion is called
pop
push
peek
display
Stack deletion is called
pop
push
peek
show
Top initially is
0
1
−1
MAX
Stack overflow when
top = −1
top = MAX−1
top = 0
none
Stack underflow when
top = −1
top = MAX
top = 1
none
Peek shows
first element
last element
top element
middle
Stack is a
linear DS
non-linear DS
tree
graph
Stack uses
queue
array
graph
tree
Stack is used in
recursion
expression evaluation
undo
all
Infix example is
AB+
A+B
+AB
ABC
Postfix example is
AB+
+AB
A+B
*AB
Conversion uses
queue
stack
tree
array
Operator precedence is highest for
+
*
−
Parenthesis has
highest precedence
lowest precedence
no precedence
equal precedence
Operators are stored in
array
stack
tree
list
Operands go to
stack
output
queue
list
Symbol used to mark stack bottom
#
$
@
*
In postfix operators appear
before operands
after operands
between operands
none
Infix-to-postfix avoids
parentheses
operators
operands
stack
Postfix evaluation uses
queue
stack
array
tree
Operands are
pushed
popped
ignored
Operator causes
one pop
two pops
no pop
push
Result is pushed back into
array
queue
stack
tree
Expression evaluated is
infix
prefix
postfix
none
' ' represents
power
multiply
divide
add
Final result is on
top
bottom
middle
none
Stack stores
characters
integers
floats
all
Evaluation follows
precedence
LIFO
FIFO
none
Postfix avoids
brackets
operands
operators
stack
Recursion means
loop
function calling itself
memory
stack
Fibonacci uses
array
recursion
stack
tree
Tower of Hanoi has
2 rods
3 rods
4 rods
5 rods
Number of moves =
n2
2n
2n−1
n
Only one disk can be moved at a time
True
False
Base case stops
recursion
program
output
stack
Fibonacci starts with
0, 1
1, 2
2, 3
3, 5
Hanoi is a
sorting
searching
recursive problem
graph
Auxiliary peg is
helper
source
destination
root
Recursion uses
stack
array
graph
queue
Queue follows
FIFO
LIFO
FILO
none
Insertion happens at
front
rear
middle
none
Deletion happens at
front
rear
middle
none
Queue overflow when
rear=MAX−1
front=−1
both
none
Queue underflow when
front>rear
rear>front
both
none
Peek returns
front element
rear element
middle
none
Queue is
linear DS
non-linear DS
tree
graph
Queue stores elements in
stack
array
tree
graph
Rear is used for
deletion
insertion
display
none
Queue is used in
scheduling
printers
BFS
all
