minsol.log
로그인
minsol.log
로그인
[DS] Queues Solution
Minsol
·
2024년 10월 30일
팔로우
0
ds
📖DS
목록 보기
9/14
Problem1 (두개의 스택으로 큐 구현하기)
두 개의 스택을 사용하여 큐 구현하기
Main idea: 첫 번째 stack은 enqueue에 사용, 두 번째 stack은 dequeue에 사용
dequeue 요청을 받았을 때 두 번째 stack이 비어있으면 첫 번째 stack의 모든 요소를 꺼내 두 번째 stack에 넣음
Solution
Problem2(큐로 스택 구현하기)
Solution
Problem3(첫 번째 유일한 문자 반환)
Solution
Minsol
👀
팔로우
이전 포스트
[DS] Stacks Solution
다음 포스트
[DS] Trees
0개의 댓글
댓글 작성