Merge Sort Algorithm | C++ / Java Complete explanation for Beginners and Code | DSA-One Course #21

Anuj Kumar Sharma May 5, 2021
Video Thumbnail
Anuj Kumar Sharma Logo

Anuj Kumar Sharma

View Channel

About

Hey, What's up guys, Anuj here. Ex Software Engineer at Amazon & Urban Company and a self-taught programmer. I started this channel to teach you all the things I have learned, things I wish I had known sooner, and things to help you along the way. I'll teach you how to learn new Programming languages, help you understand Data Structures and Algorithms, and develop your soft skills. My goal is to provide you the best advice I can through tutorials so that you can crack the dream company you deserve.

Video Description

Hey guys, In this video, we'll be learning about Merge Sort Algorithm. We'll go through the concepts behind the Merge sort algorithms and understand the code behind the algorithm. We'll also analyse the Time Complexity of Merge sort as well. 📍Join my paid Java DSA course here: https://www.codingshuttle.com/courses/batch/dsa-prime 📍Spring Boot 0 to 100 course: https://www.codingshuttle.com/courses/batchBundle/java-spring-boot-0-to-100/ 📍React 0 to 100 course: https://www.codingshuttle.com/courses/batchBundle/react-0-to-100/ 🚀 Follow me on: Instagram: https://www.instagram.com/Anuj.Kumar.Sharma Linkedin: https://www.linkedin.com/in/sharma-kumar-anuj/ X: https://x.com/sudoanuj Hashtags: #anujbhaiya #dsaone Ignore these tags: merge sort merge sort algorithm merge sort java merge sort in java merge sort in data structure merge sort c++ mergesort anuj bhaiya merge sort in c++ merge sort in c merge sort code merge sort program in c merge sort algoritması merge sort in python merge sorting merg sort merge sort python marge sort merge sort love babbar merge short quick sort merge sorted array merge sort in daa merge sort anuj bhaiya merge sort time complexity merge sort animation merge sort javascript sorting algorithms merge sort in hindi merge sort algorithm java sorting in java dsa java merge sort what is merge sort merge merge sort implementation merge sort c merge sort using recursion sorting algorithm mergesort java sorting merge sort explained merge sort program quick sort algorithm anuj bhaiya dsa merge sort algo merge sort anuj merge sort recursion merge sort algorithm in java insertion sort merge sort cpp merge sort in cpp merge two sorted arrays java dsa merge sort apna college sorting algorithms in java anuj bhaiya java anuj bhaiya merge sort data structures and algorithms merge algorithm merge sort pepcoding merge without extra space dsa java merge sort gate smashers merge sort jenny time complexity of merge sort merge sort analysis all sorting algorithms love babbar merge sort algorithm in hindi merge sort code with harry merge sort example sorting in python bubble sort dsa course heap sort merge sort divide and conquer merge sort for linked list merge sort program in java merge sort visualization mergesort algorithm sort sorting algorithms in data structures sorting in data structure data structure dsa one mearge sort merge sort abdul bari merge sort hindi merge sort in python in hindi merge sorting in data structure merger sort quick sort in java sorting algorithms interview questions algorithm for merge sort apna college count inversion java + dsa merge intervals merge sort algorithms merge sort dance quicksort recursion anuj bhaiya resume count inversions in an array in place merge sort merge sort algorithm c++ merge sort c# merge sort explanation merge sort program in c++ selection sort binary search data structures and algorithms in java dsa anuj bhaiya dsa code harry dsa in java merge sorr merge sort algoritm merge sort linked list merge sort program in python merge sort python hindi merge sorting in python merging radix sort in data structure recursion in java sorting algorithm playlist sorting and merging in python sorting in c++ two way merge sort how merge sort works bubble sort working of merge sort merge sort program in c merge sort merge sort algorithm merge sort java merge sort in java merge sort in data structure merge sort c++ anuj bhaiya mergesort merge sort in c++ merge sort in c merge sort program in c merge sort code merge sorting merg sort merge sort in python merge sort python marge sort quick sort merge sort time complexity merge sort in daa merge sorted array merge sort anuj bhaiya merge sort animation merge sort algorithm java merge short java merge sort dsa merge merge sort in hindi what is merge sort merge sort javascript merge sort anuj merge sort program merge sort algorithm in java merge sort implementation mergesort java sorting algorithms sorting in java sorting algorithms in java anuj bhaiya dsa data structures and algorithms merge sort explained sorting anuj bhaiya java merge two sorted arrays merge sort jenny quick sort algorithm sorting algorithm all sorting algorithms insertion sort merge algorithm merge sort analysis sorting algorithms in data structures anuj bhaiya merge sort data structure dsa java love babbar merge sort algo merge sort pepcoding merge sort program in java merge sort recursion merge sort visualization merge without extra space quick sort in java time complexity of merge sort heap sort merge sort abdul bari merge sort algorithm in hindi merge sort c merge sort code with harry merge sort hindi merger sort sorting in data structure algorithm for merge sort apna college dsa one mearge sort merge sort apna college merge sort example merge sort explanation merge sort in cpp

Code Like a Pro: Must-Have Essentials

AI-recommended products based on this video

Loading...
Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

(0)
$29.99
$6.99 delivery Dec 23, 2025 - Jan 2, 2026
700+ bought in past month
Loading...
NAFYRE N11 PRO GPS Drone with Camera for Adults 4K UHD, 90 Min Long Flight Time, Long Control Range, Auto Return, Follow Me, Brushless Motor, 5G FPV RC Quadcopter for Beginners

NAFYRE N11 PRO GPS Drone with Camera for Adults 4K UHD, 90 Min Long Flight Time, Long Control Range, Auto Return, Follow Me, Brushless Motor, 5G FPV RC Quadcopter for Beginners

(108)
$149.98
FREE delivery Wed, Aug 20
100+ bought in past month
Loading...
Super Enduring Brushless Motor Drone with Camera for Beginners, CHUBORY A68 WiFi FPV Quadcopter with 2K HD Camera, Auto Hover, 3D Flips, Headless Mode, Trajectory Flight

Super Enduring Brushless Motor Drone with Camera for Beginners, CHUBORY A68 WiFi FPV Quadcopter with 2K HD Camera, Auto Hover, 3D Flips, Headless Mode, Trajectory Flight

(1,063)
$89.99
FREE delivery Wed, Aug 20
Loading...
Brushless Super Endurance Foldable Drone for Beginners 35+ mins Flight Time Drone with 90° Wide-Angle 2K HD Camera, Follow me, Dual Cameras, Auto Hover and Trajectory Flight(3 Batteries)

Brushless Super Endurance Foldable Drone for Beginners 35+ mins Flight Time Drone with 90° Wide-Angle 2K HD Camera, Follow me, Dual Cameras, Auto Hover and Trajectory Flight(3 Batteries)

(0)
$199.99
PrimeFREE delivery Sun, Jun 15
Loading...
140W C to Magnetic 3 Charger, Compatible with MacBook Air 13, 15 Inch/Mac Book Pro 14, 16 Inch, M1/M2/M3/M4 from 2021/2022/2023/2024/2025 Models, 6.6FT【Original Quality】

140W C to Magnetic 3 Charger, Compatible with MacBook Air 13, 15 Inch/Mac Book Pro 14, 16 Inch, M1/M2/M3/M4 from 2021/2022/2023/2024/2025 Models, 6.6FT【Original Quality】

(71)
$49.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
UGREEN USB to USB C Adapter & USB C to USB Adapter Combo 4-Pack, 10Gbps Type-C Converter, Car Charger Compatible with MacBook Pro, iPad Mac mini, iPhone 17/16, Galaxy, PC/Laptop, Hard Drive Enclosure

UGREEN USB to USB C Adapter & USB C to USB Adapter Combo 4-Pack, 10Gbps Type-C Converter, Car Charger Compatible with MacBook Pro, iPad Mac mini, iPhone 17/16, Galaxy, PC/Laptop, Hard Drive Enclosure

(86)
$9.74
Prime
Loading...
10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

(1)
$99.99
FREE delivery Mon, Aug 11
Loading...
ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

(49)
$117.29$102.21
$6.86 delivery Thu, Aug 14
Loading...
7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

(61)
$68.99
FREE delivery Tue, Aug 12
Loading...
BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

(288)
$54.14
FREE delivery Sun, Jun 22
Loading...
LISEN USB C to USB C Cable 240W, [6.6ft 2Pack]Nylon Braided Type C Cable Fast Charge for iPhone 17 Pro Max USBC Fast Charging Cord for iPhone 17 16 Pro Air Samsung Macbook iPad Air 4/5 Xbox, Midnight
Best Seller

LISEN USB C to USB C Cable 240W, [6.6ft 2Pack]Nylon Braided Type C Cable Fast Charge for iPhone 17 Pro Max USBC Fast Charging Cord for iPhone 17 16 Pro Air Samsung Macbook iPad Air 4/5 Xbox, Midnight

(4,565)
$17.99
Prime
1K+ bought in past month
Loading...
Syntech Link Cable 16FT for PCVR Compatible with Oculus/Quest 3/Meta Quest 3S, Quest2/Pro/Pico 4/Ultra Accessories and PC/SteamVR, High Speed PC Data Transfer, USB 3.0 to USB C Cable for VR Headset
Best Seller

Syntech Link Cable 16FT for PCVR Compatible with Oculus/Quest 3/Meta Quest 3S, Quest2/Pro/Pico 4/Ultra Accessories and PC/SteamVR, High Speed PC Data Transfer, USB 3.0 to USB C Cable for VR Headset

(19,554)
$24.99
FREE delivery Tue, Jun 17 on your first order
300+ bought in past month
Loading...
USB to USB C Cable for iPhone 16/15 [MFi Certified] Carplay Cable Car Charger Cord 6FT/4Pack Compatible with iPhone 16/16 Plus/16 Pro/16 Pro Max, iPhone 15/15 Plus/15 Pro/15 Pro Max,iPad Air/Mini

USB to USB C Cable for iPhone 16/15 [MFi Certified] Carplay Cable Car Charger Cord 6FT/4Pack Compatible with iPhone 16/16 Plus/16 Pro/16 Pro Max, iPhone 15/15 Plus/15 Pro/15 Pro Max,iPad Air/Mini

(1,176)
$16.97
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
Car Carplay Cable for iPhone 16/16 Pro Max/16 Plus/15 Pro Max Plus, 3.3ft USB to USB C Cable Compatible with Apple Car Play iPhone 16 15 Cord, USB A to USB C Car Charger Cable Cord (Black)

Car Carplay Cable for iPhone 16/16 Pro Max/16 Plus/15 Pro Max Plus, 3.3ft USB to USB C Cable Compatible with Apple Car Play iPhone 16 15 Cord, USB A to USB C Car Charger Cable Cord (Black)

(2)
$8.99
FREE delivery Sun, Jun 15 on your first order
Loading...
16.4Ft/5M Long USB C Cable, Durable USB A to USB C Charging and Data Sync Cord, Power Extension Cable for Any USB-C Enabled Security Cameras Phones Tablets Switch Pro Controller and More

16.4Ft/5M Long USB C Cable, Durable USB A to USB C Charging and Data Sync Cord, Power Extension Cable for Any USB-C Enabled Security Cameras Phones Tablets Switch Pro Controller and More

(95)
$11.99
FREE delivery Sat, Jun 14 on your first order
Loading...
Amazon Basics 256GB Ultra Fast USB 3.1 High Capacity Flash Drive for Fast Data Transfer and Storage, Black
Best Seller

Amazon Basics 256GB Ultra Fast USB 3.1 High Capacity Flash Drive for Fast Data Transfer and Storage, Black

(25,693)
$21.99$19.79
FREE delivery Sun, Aug 10 on your first order
2K+ bought in past month
Loading...
2 Pack 32GB USB Flash Drive, 2.0 USB Stick Thumb Drive,Waterproof Function with Lanyard USB Memory Stick for Data Storage and Backup, Black

2 Pack 32GB USB Flash Drive, 2.0 USB Stick Thumb Drive,Waterproof Function with Lanyard USB Memory Stick for Data Storage and Backup, Black

(332)
$15.19
FREE delivery Sat, Jun 14 on your first order
Loading...
Anker 332 USB-C Hub (5-in-1) with 4K HDMI Display, 5Gbps - and 2 5Gbps USB-A Data Ports and for MacBook Pro, MacBook Air, Dell XPS, Lenovo Thinkpad, HP Laptops and More

Anker 332 USB-C Hub (5-in-1) with 4K HDMI Display, 5Gbps - and 2 5Gbps USB-A Data Ports and for MacBook Pro, MacBook Air, Dell XPS, Lenovo Thinkpad, HP Laptops and More

(11,639)
$23.99
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month
Loading...
2PC Lymphatic Contour Face Brush - Facial Massager with Ultra-Soft Bristles for Lymphatic Drainage, Facial Cleansing Brushing, Puffiness Reduction & Skin Sculpting with 2PC Gua Sha Facial Tool (One size, count, 2)

2PC Lymphatic Contour Face Brush - Facial Massager with Ultra-Soft Bristles for Lymphatic Drainage, Facial Cleansing Brushing, Puffiness Reduction & Skin Sculpting with 2PC Gua Sha Facial Tool (One size, count, 2)

(1)
$21.99
FREE delivery Jan 7 - 16
Loading...
3PCS Dent Puller – Multi-Use Car Dent Puller Tool Kit, 10-in-1 Suction Cup Dent Remover for Vehicle Repair, Glass, Screens, Tile & Object Lifting

3PCS Dent Puller – Multi-Use Car Dent Puller Tool Kit, 10-in-1 Suction Cup Dent Remover for Vehicle Repair, Glass, Screens, Tile & Object Lifting

(19)
$19.99
FREE delivery Fri, Oct 31 on your first order
Loading...
JETech Screen Protector for iPhone 17 6.3-Inch, Tempered Glass Film with Easy Installation Tool, 9H Hardness, Case-Friendly, 3-Pack
Best Seller

JETech Screen Protector for iPhone 17 6.3-Inch, Tempered Glass Film with Easy Installation Tool, 9H Hardness, Case-Friendly, 3-Pack

(45,653)
$10.99
FREE delivery Sun, Oct 19 on your first order
4K+ bought in past month
Loading...
eufy Security Solo Indoor Cam C120, 2K Security Indoor Camera, Plug-in Camera with Wi-Fi, IP Camera, Human & Pet AI, Voice Assistant Compatibility, Night Vision, Two-Way Audio, HomeBase not Compatible

eufy Security Solo Indoor Cam C120, 2K Security Indoor Camera, Plug-in Camera with Wi-Fi, IP Camera, Human & Pet AI, Voice Assistant Compatibility, Night Vision, Two-Way Audio, HomeBase not Compatible

(9,150)
$44.99
FREE delivery Thu, Sep 4
100+ bought in past month
Loading...
VASAGLE Side Table with Charging Station, 3-Tier End Table with USB Ports and Outlets, Nightstand for Living Room, Bedroom, 11.8 x 13.4 x 22.8 Inches, Plug-in Series, Rustic Brown and Black

VASAGLE Side Table with Charging Station, 3-Tier End Table with USB Ports and Outlets, Nightstand for Living Room, Bedroom, 11.8 x 13.4 x 22.8 Inches, Plug-in Series, Rustic Brown and Black

(2,283)
$41.99
Loading...
LINENSPA 14 Inch Folding Metal Platform Bed Frame - 13 Inches of Clearance - Tons of Under Bed Storage - Heavy Duty Construction - 5 Minute Assembly - Full

LINENSPA 14 Inch Folding Metal Platform Bed Frame - 13 Inches of Clearance - Tons of Under Bed Storage - Heavy Duty Construction - 5 Minute Assembly - Full

(26,286)
$100.79$93.23
FREE delivery Wed, Jun 25