Problems with a FIFO pattern, and writing code that solves them: merging sorted queues, recursion on a queue — exercise

Did you try it yourself yet?האם כבר ניסיתם לפתור בעצמכם?

Trying first, even if it fails, lets the exercise teach you. Show the solution now?לנסות לפני צפייה בפתרון, היא דרך טובה מאד ללמוד. האם להציג את הפתרון?