leetcode 232
-
232. Implement Queue using StacksProgramming/leetcode 2021. 2. 18. 10:16
stack을 이용해서 queue를 구현하는 것 python의 list는 특정 index에서도 remove가 가능하다. queue명령어들은 다음과 같다. void push(int x) Pushes element x to the back of the queue. -> queue의 맨 뒤에 넣으면 되겠다/ int pop() Removes the element from the front of the queue and returns it. -> queue의 맨 앞을 pop하면 되겠다. int peek() Returns the element at the front of the queue. -> queue의 맨 앞의 원소 boolean empty() Returns true if the queue is empty, f..