diff --git a/codes/kotlin/chapter_backtracking/subset_sum_i.kt b/codes/kotlin/chapter_backtracking/subset_sum_i.kt index f9ce82a8e..1fd1114e8 100644 --- a/codes/kotlin/chapter_backtracking/subset_sum_i.kt +++ b/codes/kotlin/chapter_backtracking/subset_sum_i.kt @@ -55,4 +55,4 @@ fun main() { println("输入数组 nums = ${nums.contentToString()}, target = $target") println("所有和等于 $target 的子集 res = $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_backtracking/subset_sum_ii.kt b/codes/kotlin/chapter_backtracking/subset_sum_ii.kt index 44a055aba..13323b7d9 100644 --- a/codes/kotlin/chapter_backtracking/subset_sum_ii.kt +++ b/codes/kotlin/chapter_backtracking/subset_sum_ii.kt @@ -59,4 +59,4 @@ fun main() { println("输入数组 nums = ${nums.contentToString()}, target = $target") println("所有和等于 $target 的子集 res = $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_computational_complexity/recursion.kt b/codes/kotlin/chapter_computational_complexity/recursion.kt index 38a368b93..1d89b7606 100644 --- a/codes/kotlin/chapter_computational_complexity/recursion.kt +++ b/codes/kotlin/chapter_computational_complexity/recursion.kt @@ -74,4 +74,4 @@ fun main() { res = fib(n) println("\n斐波那契数列的第 $n 项为 $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_dynamic_programming/coin_change.kt b/codes/kotlin/chapter_dynamic_programming/coin_change.kt index 6f1e61229..c89bbf11b 100644 --- a/codes/kotlin/chapter_dynamic_programming/coin_change.kt +++ b/codes/kotlin/chapter_dynamic_programming/coin_change.kt @@ -68,4 +68,4 @@ fun main() { // 空间优化后的动态规划 res = coinChangeDPComp(coins, amt) println("凑到目标金额所需的最少硬币数量为 $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_dynamic_programming/knapsack.kt b/codes/kotlin/chapter_dynamic_programming/knapsack.kt index 44a9115f1..868beab1f 100644 --- a/codes/kotlin/chapter_dynamic_programming/knapsack.kt +++ b/codes/kotlin/chapter_dynamic_programming/knapsack.kt @@ -131,4 +131,4 @@ fun main() { // 空间优化后的动态规划 res = knapsackDPComp(wgt, _val, cap) println("不超过背包容量的最大物品价值为 $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_greedy/max_product_cutting.kt b/codes/kotlin/chapter_greedy/max_product_cutting.kt index 6945f8aac..9d6a4735f 100644 --- a/codes/kotlin/chapter_greedy/max_product_cutting.kt +++ b/codes/kotlin/chapter_greedy/max_product_cutting.kt @@ -36,4 +36,4 @@ fun main() { // 贪心算法 val res = maxProductCutting(n) println("最大切分乘积为 $res") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_hashing/hash_map_chaining.kt b/codes/kotlin/chapter_hashing/hash_map_chaining.kt index 1eb1eb47c..e59df4a6e 100644 --- a/codes/kotlin/chapter_hashing/hash_map_chaining.kt +++ b/codes/kotlin/chapter_hashing/hash_map_chaining.kt @@ -142,4 +142,4 @@ fun main() { map.remove(12836) println("\n删除 12836 后,哈希表为\nKey -> Value") map.print() -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_heap/my_heap.kt b/codes/kotlin/chapter_heap/my_heap.kt index 453bdf0d4..23b5b4f06 100644 --- a/codes/kotlin/chapter_heap/my_heap.kt +++ b/codes/kotlin/chapter_heap/my_heap.kt @@ -155,4 +155,4 @@ fun main() { /* 判断堆是否为空 */ val isEmpty = maxHeap.isEmpty() print("\n堆是否为空 $isEmpty\n") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_sorting/heap_sort.kt b/codes/kotlin/chapter_sorting/heap_sort.kt index 745d80ff1..a0f59448c 100644 --- a/codes/kotlin/chapter_sorting/heap_sort.kt +++ b/codes/kotlin/chapter_sorting/heap_sort.kt @@ -48,4 +48,4 @@ fun main() { val nums = intArrayOf(4, 1, 3, 1, 5, 2) heapSort(nums) println("堆排序完成后 nums = ${nums.contentToString()}") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_sorting/insertion_sort.kt b/codes/kotlin/chapter_sorting/insertion_sort.kt index 015127d97..57ff3f3cb 100644 --- a/codes/kotlin/chapter_sorting/insertion_sort.kt +++ b/codes/kotlin/chapter_sorting/insertion_sort.kt @@ -26,4 +26,4 @@ fun main() { val nums = intArrayOf(4, 1, 3, 1, 5, 2) insertionSort(nums) println("插入排序完成后 nums = ${nums.contentToString()}") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_sorting/merge_sort.kt b/codes/kotlin/chapter_sorting/merge_sort.kt index 113875422..16a15c942 100644 --- a/codes/kotlin/chapter_sorting/merge_sort.kt +++ b/codes/kotlin/chapter_sorting/merge_sort.kt @@ -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()}") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_stack_and_queue/linkedlist_deque.kt b/codes/kotlin/chapter_stack_and_queue/linkedlist_deque.kt index 96df41088..88ad60827 100644 --- a/codes/kotlin/chapter_stack_and_queue/linkedlist_deque.kt +++ b/codes/kotlin/chapter_stack_and_queue/linkedlist_deque.kt @@ -160,4 +160,4 @@ fun main() { /* 判断双向队列是否为空 */ val isEmpty = deque.isEmpty() println("双向队列是否为空 = $isEmpty") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_stack_and_queue/linkedlist_queue.kt b/codes/kotlin/chapter_stack_and_queue/linkedlist_queue.kt index 64720de8a..cc0da41aa 100644 --- a/codes/kotlin/chapter_stack_and_queue/linkedlist_queue.kt +++ b/codes/kotlin/chapter_stack_and_queue/linkedlist_queue.kt @@ -95,4 +95,4 @@ fun main() { /* 判断队列是否为空 */ val isEmpty = queue.isEmpty() println("队列是否为空 = $isEmpty") -} +} \ No newline at end of file diff --git a/codes/kotlin/chapter_tree/binary_tree_bfs.kt b/codes/kotlin/chapter_tree/binary_tree_bfs.kt index db051f8c9..65e687721 100644 --- a/codes/kotlin/chapter_tree/binary_tree_bfs.kt +++ b/codes/kotlin/chapter_tree/binary_tree_bfs.kt @@ -39,4 +39,4 @@ fun main() { /* 层序遍历 */ val list = levelOrder(root) println("\n层序遍历的节点打印序列 = $list") -} +} \ No newline at end of file diff --git a/codes/kotlin/utils/ListNode.kt b/codes/kotlin/utils/ListNode.kt index 631e03e7f..2fad5f77d 100644 --- a/codes/kotlin/utils/ListNode.kt +++ b/codes/kotlin/utils/ListNode.kt @@ -22,4 +22,4 @@ class ListNode(var _val: Int) { return dum.next } } -} +} \ No newline at end of file diff --git a/codes/kotlin/utils/PrintUtil.kt b/codes/kotlin/utils/PrintUtil.kt index 0c078e398..2e5c7a363 100644 --- a/codes/kotlin/utils/PrintUtil.kt +++ b/codes/kotlin/utils/PrintUtil.kt @@ -104,4 +104,4 @@ fun printHeap(queue: Queue?) { println("堆的树状表示:") val root = TreeNode.listToTree(list) printTree(root) -} +} \ No newline at end of file