Skip to content

Commit 98d7f5d

Browse files
committed
Create README - LeetHub
1 parent be355da commit 98d7f5d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

148-sort-list/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h2><a href="https://leetcode.com/problems/sort-list/">148. Sort List</a></h2><h3>Medium</h3><hr><div><p>Given the <code>head</code> of a linked list, return <em>the list after sorting it in <strong>ascending order</strong></em>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong>Example 1:</strong></p>
5+
<img alt="" src="https://assets.leetcode.com/uploads/2020/09/14/sort_list_1.jpg" style="width: 450px; height: 194px;">
6+
<pre><strong>Input:</strong> head = [4,2,1,3]
7+
<strong>Output:</strong> [1,2,3,4]
8+
</pre>
9+
10+
<p><strong>Example 2:</strong></p>
11+
<img alt="" src="https://assets.leetcode.com/uploads/2020/09/14/sort_list_2.jpg" style="width: 550px; height: 184px;">
12+
<pre><strong>Input:</strong> head = [-1,5,3,4,0]
13+
<strong>Output:</strong> [-1,0,3,4,5]
14+
</pre>
15+
16+
<p><strong>Example 3:</strong></p>
17+
18+
<pre><strong>Input:</strong> head = []
19+
<strong>Output:</strong> []
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
<p><strong>Constraints:</strong></p>
24+
25+
<ul>
26+
<li>The number of nodes in the list is in the range <code>[0, 5 * 10<sup>4</sup>]</code>.</li>
27+
<li><code>-10<sup>5</sup> &lt;= Node.val &lt;= 10<sup>5</sup></code></li>
28+
</ul>
29+
30+
<p>&nbsp;</p>
31+
<p><strong>Follow up:</strong> Can you sort the linked list in <code>O(n logn)</code> time and <code>O(1)</code> memory (i.e. constant space)?</p>
32+
</div>

0 commit comments

Comments
 (0)