We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 524c712 commit 8481c6dCopy full SHA for 8481c6d
1 file changed
src/4_Lists/merge.cpp
@@ -3,19 +3,6 @@
3
*
4
* MERGE TWO SORTED LINKED LISTS
5
6
- * Merge two sorted linked lists into a single sorted list. Two solutions are
7
- * provided:
8
- *
9
- * 1. Optimal (Two-Pointer) Solution:
10
- * - Uses two indices to traverse both lists simultaneously, appending the
11
- * smaller element at each step.
12
- * - Time Complexity: O(n + m) where n and m are the sizes of the two lists.
13
14
- * 2. Alternative (Concatenate and Sort) Solution:
15
- * - First concatenates both lists into one, then sorts the resulting list.
16
- * - Simpler to implement but less efficient due to the sorting step.
17
- * - Time Complexity: O((n + m) log(n + m))
18
19
* ASCII Illustration:
20
21
* List1: 1 -> 3 -> 5
0 commit comments