Heap과 Priority Queue의 차이점


If you have only inset/remove methods, then there is no difference. If you need to traverse your queue/data, values of which are the data itself, then the priority queue will allow you access a sorted list of these values and a heap won’t.

Quoting Algorithms Unlocked by Thomas Cormen p.97 : “The descriptions of the priority queue operations say just what the operations do, and not how they do it.” So your interpretation is correct.

삽입/삭제만 한다면 차이점은 없지만, 모든 데이터를 횡단할때 Queue는 정렬된 상태로 나오지만 Heap은 비정렬된 상태로 나온다, 우선순위 큐는 추상적인 개념이지, 어떻게 구성하는지가 아니다 

( 즉, 자료구조와 개념의 차이. 예로 배열로 만들던 연결리스트로 만들던 우선순위 큐의 기능들이 부합된다면 그것은 우선순위 큐이다!)

참조:

https://www.quora.com/What-is-the-difference-between-a-Priority-Queue-and-a-Min-Max-Heap

댓글

이 블로그의 인기 게시물

2D 총게임 반동 표시

Simple Stupid Funnel 후기