mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-23 06:46:34 +08:00
Improve readability of Kotlin code (#1236)
* style(kotlin): Improve kotlin codes readability. * remove redundant quotes. * style(kotlin): improve codes readability.
This commit is contained in:
@@ -25,7 +25,7 @@ fun testPop(heap: Queue<Int>) {
|
||||
fun main() {
|
||||
/* 初始化堆 */
|
||||
// 初始化小顶堆
|
||||
val minHeap: PriorityQueue<Int>
|
||||
var minHeap = PriorityQueue<Int>()
|
||||
|
||||
// 初始化大顶堆(使用 lambda 表达式修改 Comparator 即可)
|
||||
val maxHeap = PriorityQueue { a: Int, b: Int -> b - a }
|
||||
|
||||
Reference in New Issue
Block a user