Merge Sort Algorithm in C++ Programming | (C++ Program) | Part – 2 | Sorting Algorithms – DSA

Support Simple Snippets by Donations –
Google Pay UPI ID – tanmaysakpal11@okicici
PayPal –
——————————————————————————————— Implement merge sort sorting algorithm using C++ programming language. In this tutorial we will write a program to implement merge sort algorithm.
If you don’t know merge sort algorithm working, please check the the part – 1 where we discuss the working of merge sort algorithm.

Full DSA playlist –
Full Code & Theory article –
C++ Programming Tutorials for Beginners Course –

Simple Snippets Official Website –
Simple Snippets on Facebook –
Simple Snippets on Instagram –
Simple Snippets on Twitter –

Simple Snippets Google Plus Page –
Simple Snippets email ID –

For More Technology News, Latest Updates and Blog articles visit our Official Website –
#mergesort #sortingalogrithms #dsa #divideandconcquer #algorithms

28 thoughts on “Merge Sort Algorithm in C++ Programming | (C++ Program) | Part – 2 | Sorting Algorithms – DSA

  1. Inside `merge()` you can't allocate the size of the array the way you did because it will return an error:
    int size = (r – l) + 1;

    int temp[size];

    …won't compile because of the following error: "expression must have a constant value of variable (declared at line #) cannot be used as a constant"

  2. Hi dude, i wanna ask this question. Why most CSE students in india don't do the development part? Everyone is just busy solving these ds algo, cp etc.

  3. How can you do

    int myarr[size]; ???

    I thought the array size should be constant unless u dynamic memory allocation such as

    int *myarr=new int(size)

    How does that code even work????

  4. Sir if I am running this program with 7 or more elements the sorted array is not getting printed and a return value of 3221225477 is getting displayed! The code is running perfectly fine with 6 or less elements though! Where do you think I might have mistanken?

Leave a Reply

Your email address will not be published. Required fields are marked *