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 – paypal.me/tanmaysakpal11
——————————————————————————————— 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 – https://www.youtube.com/watch?v=XCyuHSJS7XE&list=PLIY8eNdw5tW_zX3OCzX7NJ8bL1p6pWfgG
Full Code & Theory article – https://simplesnippets.tech/merge-sort-algorithm-with-example-with-c-code-sorting-algorithms-data-structures/
C++ Programming Tutorials for Beginners Course – https://www.youtube.com/watch?v=AKNGgAXTark&list=PLIY8eNdw5tW_o8gsLqNBu8gmScCAqKm2Q

Simple Snippets Official Website –
http://simplesnippets.tech/
Simple Snippets on Facebook –
https://www.facebook.com/simplesnippets/
Simple Snippets on Instagram –
https://www.instagram.com/simplesnippets/
Simple Snippets on Twitter –

Simple Snippets Google Plus Page –
https://plus.google.com/+SimpleSnippets
Simple Snippets email ID –
simplesnippetsinfo@gmail.com

For More Technology News, Latest Updates and Blog articles visit our Official Website – http://simplesnippets.tech/
#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 *