1월, 2022의 게시물 표시

HPA* pathfinding time data

이미지
clusterLength = 10 , max hierarchy level = 1 100x100  0.0017 second = 1.7 millisecond 0.004  0.0018  0.0016  0.002  300x300 0.02 s = 20 ms 0.019 0.015 0.003 0.007 0.031 500x500 = Average gap is big because of lacking hierarchy level 0.2 s = 200 ms 0.029s 0.006s 0.051s 0.035s 0.09s

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

Binary Tree, Binary Search Tree, Binary Heap 메모

이미지
1. BinaryTree = 말 그대로 이진트리.  이 자료구조는 노드당 0~2개의 자식을 지닌다.채워지는 순서는 뿌리부터 채워져있는지 확인하고, 그다음 왼쪽 자식에서 오른쪽 자식으로 채워지며 모두 채워졌으면 그 자식의 자식으로 순환한다. 1-1 Full Binary Tree or Strict Binary Tree 자식이 2개 혹은 0인 트리다. 1-2 Complete Binary Tree 마지막레벨을 제외한 모든 레벨이 채워져있고 노드가 왼쪽에서 오른쪽으로 순서대로 채워져있는 트리.       0                                          0    0     0                                    0    0 0  0   X  0                               0  0  0     NO                                       OK 1-3 Perfect Binary Tree 모든 노드는 2개의 자식을 지니며 동일한 레벨을 갖는다.        0     0    0   0  0  0  0      OK 1-4 Balanced Binary Tree 왼쪽과 오른쪽 높이 차이가 1 레벨식 나뉘어져있는 것        0                                  0      0   0                            0        0  0                              0  0     OK                                NO 2. Binary Search Tree = 이진 탐색 트리.  이진트리에 검색할 시간을 더 빠르게 하기위해 고안된 구조. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 4