Leetcode 21. Merge Two Sorted Lists (2 solutions)

Опубликовано: 20 Март 2026
на канале: ComputerBread
335
16

Hey guys, welcome back to another leetcode video.
Today, we look at the easy leetcode problem 21. Merge Two Sorted Lists

The goal is to merge two sorted linked list into a single one.
This problem can be a bit tricky, but by carefully thinking about it, we can come up with 2 solutions.
An iterative solution and a recursive solution.

I hope you will enjoy it!

Leetcode playlist:    • Interview Question  
JavaScript playlist:    • JavaScript  

Leetcode question: https://leetcode.com/problems/merge-t...
Code: https://github.com/ComputerBread/leet...

To support me (if you feel like it): https://ko-fi.com/computerbread/
Cheatcheet/mindmap: https://ko-fi.com/s/34966c8fb1
Twitter:   / computerbread  
Subscribe: https://www.youtube.com/@ComputerBrea...

Chapters:
00:00 Introduction
00:24 Solution 1 (iterative)
05:31 Solution 2 (recursive)
08:19 Comparison
08:57 Conclusion

(for the algorithm)
Every software engineer, developer, programmer, computer science student looking for a high paying job, 6 figures, millionaire, should spend time to grind leetcode to ace technical interviews. If you want to be cracked, you need to crack leetcode!

Linked list, list, abstract data type,

#javascript #leetcode #c #cprogramming