Challenge 4: Implement a Queue Using Stacks
You have seen the difference between stacks and queues. But is it possible to make one from the other? Let's find out!
Problem statement
You have to implement enqueue()
and dequeue()
functions in the newQueue
class by using the myStack
class created earlier. enqueue()
will insert a value into the queue and dequeue
will ...
Access this course and 1400+ top-rated courses and projects.