mirror of
https://github.com/krahets/hello-algo.git
synced 2025-08-02 19:53:11 +08:00
build
This commit is contained in:
@ -220,7 +220,9 @@ comments: true
|
||||
|
||||
/* 交换元素 */
|
||||
private fun swap(i: Int, j: Int) {
|
||||
maxHeap[i] = maxHeap[j].also { maxHeap[j] = maxHeap[i] }
|
||||
val temp = maxHeap[i]
|
||||
maxHeap[i] = maxHeap[j]
|
||||
maxHeap[j] = temp
|
||||
}
|
||||
|
||||
/* 获取堆大小 */
|
||||
|
Reference in New Issue
Block a user