Post

Stack, Queue

✅ Stack

  • LIFO: Last in First Out
  • push()
  • pop()

✅ Queue

  • FIFO : First in First Out
  • offer()
  • poll()

✅ Deque

  • Double End Queue
  • queue with both sides open
  • queuestack
  • Stack에서 쓰듯이 push(), pop()하면 뒤에서 넣고 빼고
  • Queue에서 쓰듯이 offer(), poll()하면 앞에서 넣고 뺸다
  • 💡 DequeStack보다 빠르기 때문에 Deque쓰는 것을 추천!

This post is licensed under CC BY 4.0 by the author.