File tree 1 file changed +6
-1
lines changed
posts/palindrome-linked-list
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,12 @@ <h2 id="thought-process">Thought Process</h2>
235
235
</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#66d9ef "> return</ span > < span style ="color:#66d9ef "> True</ span >
236
236
</ span > </ span > </ code > </ pre > </ div > < h2 id ="timespace-complexity "> Time/Space Complexity</ h2 >
237
237
< ul >
238
- < li > Time: \( O(n) \) since \( O(n) \) to find the mid + \( O(n) \) to use two-pointer technique to reverse the second-half of the linked list</ li >
238
+ < li >
239
+ < p > Time: \( O(n) \) since \( O(n) \) to find the mid + \( O(n) \) to use two-pointer technique to reverse the second-half of the linked list</ p >
240
+ </ li >
241
+ < li >
242
+ < p > Space: \( O(1) \) since we are not using any extra space, just pointers</ p >
243
+ </ li >
239
244
</ ul >
240
245
< h2 id ="related-problemshow-do-you-feel-about-this-question "> Related Problems/How do you feel about this question?</ h2 >
241
246
You can’t perform that action at this time.
0 commit comments