Domanda di colloquio di Thomson Reuters

How do you convert stack to queue? SQL query to find the peak element.