mirror of
https://github.com/krahets/hello-algo.git
synced 2025-08-02 11:33:18 +08:00
build
This commit is contained in:
@ -649,7 +649,7 @@ We can encapsulate the index mapping formula into functions for convenient later
|
||||
|
||||
/* 获取父节点的索引 */
|
||||
int parent(MaxHeap *maxHeap, int i) {
|
||||
return (i - 1) / 2;
|
||||
return (i - 1) / 2; // 向下取整
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user