From db78f1a2c1dc8159aa56bbffed8b06e2dd70953f Mon Sep 17 00:00:00 2001 From: YDZ Date: Sun, 31 Mar 2019 20:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20problem=2061?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Rotate List.go => 61. Rotate List/61. Rotate List.go} | 0 .../61. Rotate List_test.go} | 0 Algorithms/{61.Rotate List => 61. Rotate List}/README.md | 4 +++- 3 files changed, 3 insertions(+), 1 deletion(-) rename Algorithms/{61.Rotate List/Rotate List.go => 61. Rotate List/61. Rotate List.go} (100%) rename Algorithms/{61.Rotate List/Rotate List_test.go => 61. Rotate List/61. Rotate List_test.go} (100%) rename Algorithms/{61.Rotate List => 61. Rotate List}/README.md (92%) diff --git a/Algorithms/61.Rotate List/Rotate List.go b/Algorithms/61. Rotate List/61. Rotate List.go similarity index 100% rename from Algorithms/61.Rotate List/Rotate List.go rename to Algorithms/61. Rotate List/61. Rotate List.go diff --git a/Algorithms/61.Rotate List/Rotate List_test.go b/Algorithms/61. Rotate List/61. Rotate List_test.go similarity index 100% rename from Algorithms/61.Rotate List/Rotate List_test.go rename to Algorithms/61. Rotate List/61. Rotate List_test.go diff --git a/Algorithms/61.Rotate List/README.md b/Algorithms/61. Rotate List/README.md similarity index 92% rename from Algorithms/61.Rotate List/README.md rename to Algorithms/61. Rotate List/README.md index 7f0bb5cc..1ecf121b 100644 --- a/Algorithms/61.Rotate List/README.md +++ b/Algorithms/61. Rotate List/README.md @@ -30,4 +30,6 @@ rotate 4 steps to the right: 2->0->1->NULL 旋转链表 K 次。 -这道题需要注意的点是,K 可能很大,K = 2000000000 ,如果是循环肯定会超时。应该找出 O(n) 的复杂度的算法才行。由于是循环旋转,最终状态其实是确定的,利用链表的长度取余可以得到链表的最终旋转结果。 \ No newline at end of file +这道题需要注意的点是,K 可能很大,K = 2000000000 ,如果是循环肯定会超时。应该找出 O(n) 的复杂度的算法才行。由于是循环旋转,最终状态其实是确定的,利用链表的长度取余可以得到链表的最终旋转结果。 + +这道题也不能用递归,递归解法会超时。 \ No newline at end of file