Merge Two Sorted Linked Lists

Опубликовано: 20 Февраль 2026
на канале: Fit Coder
6,876
66

In this video, I have explained how to merge two sorted linked lists.
Given the heads of 2 sorted linked lists, merge the 2 lists into 1 sorted linked list and return its head.
I have explained two methods to solve this:
Method 1: Using Extra Space
Method 2: Using 2 pointers, No Extra Space

Source code: https://github.com/fit-coder/fitcoder...

00:00 Introduction
00:08 Problem explanation
01:03 Method 1: Inefficient Brute Force
02:24 Method 2: Using 2 pointers, No Extra Space
11:26 Implementation

Merge K Sorted Linked Lists:    • Merge K Sorted Linked Lists | 4 Methods  

-------------------------------------------------------------
I live in New Delhi and love explaining programming concepts. I have done M.Tech(BITS Pilani) + B.Tech(PEC, Chandigarh) in Computer Science and am currently working as a software engineer in a MNC.
If you like my content, please like, share my videos and subscribe to the channel.
-------------------------------------------------------------

For Linked List tutorials, please refer to the below playlist:
   • Linked List  

For Binary tree tutorials, please refer to the below playlist:
   • Tree Data Structures  

For Binary search tree tutorials, please refer to the below playlist:
   • Binary Search Tree  

For in-depth Graph theory and implementation details, please refer to the below playlist:
   • Graph Algorithms  

#DataStructure,#LinkedList,#FitCoder,#Algorithm,#competitiveprogramming,#faang,#codinginterview