From 2f2e8488d344d5392c9000d85a4e6c640349bd8e Mon Sep 17 00:00:00 2001 From: juan Date: Tue, 20 Sep 2022 13:19:16 +0800 Subject: [PATCH] vault backup: 2022-09-20 13:19:16 --- OJ notes/pages/Leetcode Reverse-Linked-List.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OJ notes/pages/Leetcode Reverse-Linked-List.md b/OJ notes/pages/Leetcode Reverse-Linked-List.md index d305147..7fb69cf 100644 --- a/OJ notes/pages/Leetcode Reverse-Linked-List.md +++ b/OJ notes/pages/Leetcode Reverse-Linked-List.md @@ -23,6 +23,7 @@ ##### Revisions: 2022-07-02 +2022-09-20 ##### Related topics: @@ -70,8 +71,15 @@ Given the `head` of a singly linked list, reverse the list, and return _the reve ### Thoughts +Many ways to implement this. from slow but easy ones, to +fast but hard ones: + +#### Easy way: + I thought a slow O(n ^ 2) hybrid solution, while there are better algorithms, using in-place insert, or recursion. +#### Fast way: + The in place insert is easier to understand, and simple to implement, using a very clever trick. > [!summary] My thoughts on the recursion algorithm