Press "Enter" to skip to content

Posts tagged as “list”

花花酱 LeetCode 21: Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

Solution 1: Iterative O(n)


Solution 2: Recursive O(n)