누구는 동일한 개념이라 그냥 자바 priortyqueue 갖다 쓰면 된다하고 누구는 엄밀히 말하면 다르다는데
뭐가 맞는거임
댓글 7
우선순위 큐를 힙으로 구현하는 것임..
익명(39.119)2021-05-25 17:29
답글
엄밀히 말하면 배열로도 구현할 수 있지 링크드 리스트나
익명(39.119)2021-05-25 17:30
우선순위큐는 우선순치(가중치)순으로 뺄 수만 있으면 우선순위큐지.
신입(117.111)2021-05-25 18:26
우선순위큐는 abstract 고 heap은 concrete 하냐의 차이
전자는 구현에 대한 제약이 없지만 후자는 tree-based 여야 한다? 당장 생각나는건 이 정도
익명(211.250)2021-05-25 18:34
답글
Wikipedia:
...a priority queue is an abstract data type...
While priority queues are often implemented with heaps, they are conceptually distinct from heaps...
우선순위 큐를 힙으로 구현하는 것임..
엄밀히 말하면 배열로도 구현할 수 있지 링크드 리스트나
우선순위큐는 우선순치(가중치)순으로 뺄 수만 있으면 우선순위큐지.
우선순위큐는 abstract 고 heap은 concrete 하냐의 차이 전자는 구현에 대한 제약이 없지만 후자는 tree-based 여야 한다? 당장 생각나는건 이 정도
Wikipedia: ...a priority queue is an abstract data type... While priority queues are often implemented with heaps, they are conceptually distinct from heaps...
heap은 heap property도 있어야
맞숩니다