Pregunta de entrevista de SAP

It was a Stack and queue question