우선순위 큐 (Priority Queues)

Henry Lee·2020년 12월 3일
0
post-thumbnail

Queue는 본래 FIFO라 배웠지만,
Priority Queue는 FIFO가 아니라 정해놓은 우선순위(Priority)에 따라 v를 dequeue한다.
(아니, 그럼 왜 큐라 이름 붙이냐;)

구현하는 방법으로,

enqueue때 Priority 적용dequeue때 Priority 적용
유리불리, O(N)

강의에서 순회할 때 getAt()으로 하지 않는다고 자주 강조함.
아직은 왜 강조하는 지 모르겠..

profile
Today I Learned. AI Engineer.

0개의 댓글