Áö½Ä! ¸Þ´º ¹Ù·Î°¡±â Áö½Ä! ³»¿ë ¹Ù·Î°¡±â

Highlight navigation

miniDaum navigation

°ü·Ã ¼­ºñ½º

°Ë»ö


ÀڷᱸÁ¶ ¾Ë°í¸®Áò c¾ð¾î·Î º¯È¯(enqueue, dequeue°ü·Ã) Áö½Ä¸Ó´Ï 60

µî·Ï¹× | 2012-04-08 20:18 | Á¶È¸ 0 | ´äº¯ 0

Problem 1. Suppose that there are two stacks. Make a queue using them.



Example input: A string where a letter means enqueue and an asterisk means dequeue in the sequence EAS*Y*QUE***S T***IO*N***.



Output: Give the sequence of values returned by the dequeue operations. Assume an empty FIFO queue initially.


 


À̰Šc¾ð¾î·Î ¾î¶»°Ô ±¸ÇöÇÒ ¼ö ÀÖÀ»±î¿ä..?

ÀÌ Áú¹®¿¡ ´äº¯ÇϽøé Áö½Ä¸Ó´Ï 5, äÅýÿ£ 90 À» ´õ µå¸³´Ï´Ù.
ÇöÀç ÀÌ Áú¹®ÀÇ Ã¹¹øÂ° ´äº¯ÀÚ°¡ µÇ¾îÁÖ¼¼¿ä.


¿ìÃø ¿µ¿ª