Domanda di colloquio di IDFC FIRST Bank

How can you convert a stack into a queue.

Risposta di colloquio

Anonimo

14 gen 2025

You can use a single stack with recursion to reverse the order. Steps: Push elements onto the stack. When dequeueing: Pop all elements except the last one using recursion. Return the last element (FIFO behavior).