NEW
Font size
WorksheetsHackharbor 3.0 Day 3:C
Total questions: 17
Worksheet time: 9mins
What is the output of pop() when the stack is empty?
-1
Segmentation Fault
"Stack Underflow"
Garbage Value
If your crush was a queue, what would you be?
Rear
Front
Stuck waiting
Dequeued
Why reset front and rear to -1 after dequeue in a queue?
To confuse beginners
Free up memory
Because queue is now empty
Because that’s what seniors do
Which operation follows LIFO?
enqueue
dequeue
push
traverse
In circular queue, how to access the next position of rear?
rear + 1
(rear + 1) / MAX
(rear + 1) % MAX
rear++
When is the queue empty?
front > rear
rear == -1
front == rear
front == rear + 1
In a queue, which pointer moves forward when dequeue is called?
rear
top
front
NULL
What happens when you mix stack with drama?
StackOverflow movie
It gets pop-ular
Overacted push
Too much LIFO
What happens when you dequeue() from an empty queue?
Segmentation fault
Returns -1
"Queue Underflow"
Deletes nothing silently
Which statement about circular queue is FALSE?
Circular queue solves the problem of unused space after dequeues
Circular queue uses modulo arithmetic for indexing
Circular queue cannot be implemented using arrays
Circular queue allows wrap-around of rear pointer
Why is (rear + 1) % MAX == front used in circular queue overflow check?
Looks cool
Ensures wrap-around
Just tradition
Saves lines of code
If a stack and a queue went on a date, who would talk last?
The stack, because it’s LIFO!
The queue, because it’s FIFO!
They’d both talk simultaneously.
Neither, they’re both silent.
What is the primary reason for using circular queues over normal queues?
They're circular
More memory efficient
More confusing for juniors
FIFO no longer applies
What’s a circular queue’s biggest insecurity?
No beginning or end
Not looking linear
Constant modulo stress
People not getting the point
If a stack broke up with its data, why?
It got popped too many times
It was too static
No overflow of feelings
Push came to shove
In queue implementation, what happens when rear reaches MAX-1 and you try to enqueue?
Queue Overflow
Queue Underflow
Stack Overflow
Circular Queue Overflow
If life were a stack, what’s the most relatable thing?
Everything keeps piling up
Pop quiz every week
Underflow of motivation
Overflow of chai
