![max heap min heap comparison](img/79e61bda9ace4c785f5b129a6b78d971.png"max heap min heap comparison")
Max Heap and Min Heap
最大堆和最小堆
...
...
@@ -106,7 +106,7 @@ heapify(array)
![graph shows how base case of heapify works](img/a8ccda62569a7c3b3b0439f6931e54a2.png"Heapify base case")
Heapify base cases
建堆的基础案例
...
...
@@ -118,7 +118,7 @@ Heapify base cases
![image showing tree data with root element containing two max-heap subtrees](img/e952b2e63ec5550fc7d1fe1c61b15f18.png"How to heapify root element when its subtrees are already max heaps")
How to heapify root element when its subtrees are already max heaps
当其子树已经是最大堆时,如何对根元素建堆
...
...
@@ -128,7 +128,7 @@ How to heapify root element when its subtrees are already max heaps
![steps to heapify root element when both of its subtrees are already max-heaps](img/34277044753dfc37c7504d8a3a18bb57.png"how to heapify root element when its subtrees are max-heaps")
How to heapify root element when its subtrees are max-heaps
当子树为最大堆时如何对根元素建堆
...
...
@@ -177,25 +177,25 @@ void heapify(int arr[], int n, int i) {
![steps to build max heap for heap sort](img/ab936410d1f44c018c8467126a5ff0b0.png"Steps to build max heap for heap sort")
Create array and calculate i
创建数组并计算`i`
![steps to build max heap for heap sort](img/e06269309304786c8832c995ed0dfe3f.png"Steps to build max heap for heap sort")
Steps to build max heap for heap sort
建立用于堆排序的最大堆的步骤
![steps to build max heap for heap sort](img/073cf6d2233a07de82308ed3512c0816.png"Steps to build max heap for heap sort")
Steps to build max heap for heap sort
建立用于堆排序的最大堆的步骤
![steps to build max heap for heap sort](img/34c80fc7342d3335e84cbb7bf3df5393.png"Steps to build max heap for heap sort")
Steps to build max heap for heap sort
建立用于堆排序的最大堆的步骤
...
...
@@ -215,7 +215,7 @@ Steps to build max heap for heap sort
![procedures for implementing heap sort](img/1e7348280393ecb6c2ee05cc288fb211.png"We need to repeatedly exchange root element with last element and heapify the root element to implement heap sort ")
![Start with a weighted graph](img/48879960b181eee06d97d17d30dd90a0.png"Dijkstra's algorithm steps")
Start with a weighted graph
从加权图开始
![Choose a starting vertex and assign infinity path values to all other devices](img/748feed816b144c6849677220de0a3d1.png"Dijkstra's algorithm steps")
Choose a starting vertex and assign infinity path values to all other devices
选择一个起始顶点并将无限路径值分配给所有其他设备
![Go to each vertex and update its path length](img/c79fedd0835603a54fc60d6db9fc1c1a.png"Dijkstra's algorithm steps")
Go to each vertex and update its path length
转到每个顶点并更新其路径长度
...
...
@@ -59,19 +59,18 @@ Go to each vertex and update its path length
![After each iteration, we pick the unvisited vertex with the least path length. So we choose 5 before 7](img/967ff9a46bd747817b6797573e2c2082.png"Dijkstra's algorithm steps")
After each iteration, we pick the unvisited vertex with the least path length. So we choose 5 before 7
每次迭代后,我们选择路径长度最小的未访问顶点。 所以我们选择 7 之前的 5
![Notice how the rightmost vertex has its path length updated twice](img/6bc46ea761b3ee379e7c8b6cbf54249e.png"Dijkstra's algorithm steps")
Notice how the rightmost vertex has its path length updated twice
注意最右边的顶点的路径长度如何更新两次
![Repeat until all the vertices have been visited](img/eaf532e8e5354f3f999ee96da53a010b.png"Dijkstra's algorithm steps")