mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-24 03:46:28 +08:00
fix(Kotlin): Remove empty lines (#1264)
This commit is contained in:
parent
30fd4ef646
commit
a3ee733e7b
16 changed files with 16 additions and 16 deletions
|
@ -55,4 +55,4 @@ fun main() {
|
|||
|
||||
println("输入数组 nums = ${nums.contentToString()}, target = $target")
|
||||
println("所有和等于 $target 的子集 res = $res")
|
||||
}
|
||||
}
|
|
@ -59,4 +59,4 @@ fun main() {
|
|||
|
||||
println("输入数组 nums = ${nums.contentToString()}, target = $target")
|
||||
println("所有和等于 $target 的子集 res = $res")
|
||||
}
|
||||
}
|
|
@ -74,4 +74,4 @@ fun main() {
|
|||
|
||||
res = fib(n)
|
||||
println("\n斐波那契数列的第 $n 项为 $res")
|
||||
}
|
||||
}
|
|
@ -68,4 +68,4 @@ fun main() {
|
|||
// 空间优化后的动态规划
|
||||
res = coinChangeDPComp(coins, amt)
|
||||
println("凑到目标金额所需的最少硬币数量为 $res")
|
||||
}
|
||||
}
|
|
@ -131,4 +131,4 @@ fun main() {
|
|||
// 空间优化后的动态规划
|
||||
res = knapsackDPComp(wgt, _val, cap)
|
||||
println("不超过背包容量的最大物品价值为 $res")
|
||||
}
|
||||
}
|
|
@ -36,4 +36,4 @@ fun main() {
|
|||
// 贪心算法
|
||||
val res = maxProductCutting(n)
|
||||
println("最大切分乘积为 $res")
|
||||
}
|
||||
}
|
|
@ -142,4 +142,4 @@ fun main() {
|
|||
map.remove(12836)
|
||||
println("\n删除 12836 后,哈希表为\nKey -> Value")
|
||||
map.print()
|
||||
}
|
||||
}
|
|
@ -155,4 +155,4 @@ fun main() {
|
|||
/* 判断堆是否为空 */
|
||||
val isEmpty = maxHeap.isEmpty()
|
||||
print("\n堆是否为空 $isEmpty\n")
|
||||
}
|
||||
}
|
|
@ -48,4 +48,4 @@ fun main() {
|
|||
val nums = intArrayOf(4, 1, 3, 1, 5, 2)
|
||||
heapSort(nums)
|
||||
println("堆排序完成后 nums = ${nums.contentToString()}")
|
||||
}
|
||||
}
|
|
@ -26,4 +26,4 @@ fun main() {
|
|||
val nums = intArrayOf(4, 1, 3, 1, 5, 2)
|
||||
insertionSort(nums)
|
||||
println("插入排序完成后 nums = ${nums.contentToString()}")
|
||||
}
|
||||
}
|
|
@ -53,4 +53,4 @@ fun main() {
|
|||
val nums = intArrayOf(7, 3, 2, 6, 0, 1, 5, 4)
|
||||
mergeSort(nums, 0, nums.size - 1)
|
||||
println("归并排序完成后 nums = ${nums.contentToString()}")
|
||||
}
|
||||
}
|
|
@ -160,4 +160,4 @@ fun main() {
|
|||
/* 判断双向队列是否为空 */
|
||||
val isEmpty = deque.isEmpty()
|
||||
println("双向队列是否为空 = $isEmpty")
|
||||
}
|
||||
}
|
|
@ -95,4 +95,4 @@ fun main() {
|
|||
/* 判断队列是否为空 */
|
||||
val isEmpty = queue.isEmpty()
|
||||
println("队列是否为空 = $isEmpty")
|
||||
}
|
||||
}
|
|
@ -39,4 +39,4 @@ fun main() {
|
|||
/* 层序遍历 */
|
||||
val list = levelOrder(root)
|
||||
println("\n层序遍历的节点打印序列 = $list")
|
||||
}
|
||||
}
|
|
@ -22,4 +22,4 @@ class ListNode(var _val: Int) {
|
|||
return dum.next
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -104,4 +104,4 @@ fun printHeap(queue: Queue<Int>?) {
|
|||
println("堆的树状表示:")
|
||||
val root = TreeNode.listToTree(list)
|
||||
printTree(root)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue