Merge Sort | Code and Explanation | C++ Course - 19.1

  Рет қаралды 483,399

Apna College

Apna College

Күн бұрын

Пікірлер: 419
@sohebshaikh3344
@sohebshaikh3344 3 жыл бұрын
accha explanation tha bs thoda code dry run kr k batate tho zyada accha hota
@akshaykumar192
@akshaykumar192 Жыл бұрын
Kahe ka acha kuch samaj ni aata 😢
@achabacha3809
@achabacha3809 Жыл бұрын
​@@akshaykumar192 😅😅😅😅
@mrpandey7312
@mrpandey7312 2 жыл бұрын
thanks to all who created this free of cost course
@tywarinabin
@tywarinabin 2 жыл бұрын
It is difficult topic but this lecture of 15 minutes make it easier and make program just in 10 minutes. Thanks Apna College Team and Aman bhaiya.
@turbo4free631
@turbo4free631 2 жыл бұрын
is this course for beginner.....
@amritpoudel6929
@amritpoudel6929 2 жыл бұрын
@@turbo4free631 NO BIG NO
@sleepypanda7172
@sleepypanda7172 2 жыл бұрын
her voice!!! too sweet! Great explanation!
@BEESaiShivam
@BEESaiShivam 3 жыл бұрын
87k views and only 2.5k likes shows that this series is not for beginners but for who already know the basics!!!!
@shishirshekhar
@shishirshekhar 3 жыл бұрын
yes
@IFYatharthAurangpureIT
@IFYatharthAurangpureIT Жыл бұрын
very correct
@Lack_Of_Enemies
@Lack_Of_Enemies 5 ай бұрын
bhai lekin sorting to beginner stuff h
@BEESaiShivam
@BEESaiShivam 5 ай бұрын
@@Lack_Of_Enemies rhne do bhai ab fms me pdta hu cat 99.5% lol maa chudaye coding
@eros4082
@eros4082 2 жыл бұрын
Code is giving undesired output if array elements are other than descending order. I have checked many testcases.
@vindhyakumar3434
@vindhyakumar3434 Жыл бұрын
bro after seeing your comment i realised the same mistake i made , maybe in int main you forgot to put mergesort(arr,0,length-1) and instead wrote mergesort(arr,0,length)
@prabhatjha2522
@prabhatjha2522 3 ай бұрын
@@vindhyakumar3434 then also It didn't work
@nithinshukla4679
@nithinshukla4679 3 жыл бұрын
fr i couldnt understand anything after didi stopped teaching😂🤣🤣🤣
@AbdUllah-m2j3j
@AbdUllah-m2j3j 8 ай бұрын
Only one of you can teach me correctly so proud you
@sajankumarkar8237
@sajankumarkar8237 3 жыл бұрын
Just another way to merge. We can take a single array of size n instead of 2 of n1 and n2. What we do is we divide the original array by marking them with the pointers i,j(not the * pointers xD). We merge and store them in the temp array and at the end we store the values in the original array. void merge1(int a[], int l, int mid, int h)// low, mid, high { int i=l, j=mid+1, k=0, n=h-l+1; int temp[n]; while(i
@adityagupta3870
@adityagupta3870 3 жыл бұрын
brother....can you explain me why the size of " n1=mid-l+1" array is taken? and in your problem also n=h-l+1?..please help I am confused
@sajankumarkar8237
@sajankumarkar8237 3 жыл бұрын
​@@adityagupta3870 ok let's say the array we take has size 10. While calling the function the value passed to low is 0 and the value passed to high is n-1(cuz if size 10 means from 0 to 9), i.e. 9 in this case. Now in the function, n denotes the size of our array(specifically size of the part of the array corresponding to the merge but here i will explain for the entire array cuz its easier to understand that way). So n needs to be 10. now low=0 and high=9, so high-low=9-0=9. So we add 1. High-low+1=9-0+1=10.
@adityagupta3870
@adityagupta3870 3 жыл бұрын
@@sajankumarkar8237 damn bro!!!.. Thanks!!!... Can I have your id or something ... So that we can start with dsa together?
@rutvikrana512
@rutvikrana512 4 жыл бұрын
Mergesort vs quicksort Quicksort will give average time complexity of O(N*log(N)) and worst case O(N*N) But mergesort gives best case as well as average case complexity O(n *log(n)) It means mergesort will not take less than this time but in average case it will be n log(n)... so if your array is small, you will still need this much time, but qsort is much faster for smaller size array because it can take O(N) in sorted array while mergesort will take n log(n) for this. So quicksort is faster than mergesort. So why use mergesort ? It is used to know inversion count. Qsort :- Fast and used in small arrays Mergesort :- stable and used for big arrays and linked list.
@veeresh4441
@veeresh4441 4 жыл бұрын
Could u tell what is inversion count ?
@rutvikrana512
@rutvikrana512 4 жыл бұрын
@@veeresh4441 ... inversion count is numbers of swaps needed to sort an array. We can easily count swaps in bubble sort also. But if we need less time complexity than we can use merge sort algorithm.
@abhigujjar7439
@abhigujjar7439 4 жыл бұрын
Not average, quicksort bestcase is O(nlogn)
@rutvikrana512
@rutvikrana512 4 жыл бұрын
@@abhigujjar7439 ... yes and no. It’s about practical results. In practice, average time of qsort is less than mergesort. Read in a book, I didn’t practice myself though 😂
@abhigujjar7439
@abhigujjar7439 4 жыл бұрын
According to books the average and best case for quick sort is O(nlogn)
@Annu_Chaudhary2004
@Annu_Chaudhary2004 Жыл бұрын
Best m best ma'am 10 marks sure ho gye isse pdh kr thanks 🙏👍
@AmanTheDisciple
@AmanTheDisciple 2 жыл бұрын
Awesome video, thanks for the easy explanation! :)
@WinaTechnologies
@WinaTechnologies 5 ай бұрын
it was a verry good video, yet , consider using meaningfull variable names , i mean a[i] = arr[l + i] seems confusing isnt it ? avoid using variable names like a and b instead use for example left_array and right_array or whatever the key point is using meaningfull variable names , otherwise i see the explanation was just clear thank you so much ❤❤❤
@code-a-mania4100
@code-a-mania4100 2 жыл бұрын
For Time comple. We get fractional part and n so it is simple it is logn*n
@pritishpattnaik4674
@pritishpattnaik4674 4 жыл бұрын
instead of using 2 more while loops in merge( ) , u can simply just change the && with || , so..we do not need those extra while loops.
@sourabhchoudhary7289
@sourabhchoudhary7289 3 жыл бұрын
I also thought so does it worked??
@amanns7080
@amanns7080 3 жыл бұрын
No it won't work, might give a segmentation fault/ wrong answer as you are accessing element of an array outside its bounds. Suppose, i has reached n1 but j hasn't reached n2, by replacing "and" with "or" in while loop, you would still enter the loop, but this time you would be checking a[n1] with b[j], a[n1] might contain garbage value. Same case if j reaches n2 first, b[n2] contains garbage value. Hope this clears your doubt.
@shreyasingh4680
@shreyasingh4680 2 жыл бұрын
no we can't do that because we would have 0 element in either array so we can't compare
@maheriyajatinbharatbhai3538
@maheriyajatinbharatbhai3538 3 жыл бұрын
thanks for this amazing playlist!
@anujjadhav2771
@anujjadhav2771 3 жыл бұрын
I am in love with this series ❤
@artirani3806
@artirani3806 4 жыл бұрын
It's special for me because it is on Apna College Video.....first time ever😇1 comment, 1st like😄
@ankurmishra1175
@ankurmishra1175 4 жыл бұрын
kzbin.info/www/bejne/aJyaoYZvrLyDiqs
@shubhamkale735
@shubhamkale735 3 жыл бұрын
Documentation of our program is very important thing because it reminds us the logic behind program make sure everyone will write reason after each code using commenting
@joebale9670
@joebale9670 2 жыл бұрын
ji sir jaisa aap kahen😶
@subratadas8408
@subratadas8408 3 жыл бұрын
Explained well thanks .
@samridhisaini6147
@samridhisaini6147 2 жыл бұрын
explanation is just so clear
@maazahmed6634
@maazahmed6634 Жыл бұрын
Microsoft Wali didi is helping Pakistanis as well❤️
@ashishbohare8864
@ashishbohare8864 2 жыл бұрын
Love u didi 😘 bdiya pdhaya
@shaktirajsinhzala4588
@shaktirajsinhzala4588 4 жыл бұрын
merge is done with only one extra array. it is not necessary to take 2 extra arrays and then merge.
@nikunjjain2382
@nikunjjain2382 4 жыл бұрын
Yes ,by using two pointer
@sourabhchoudhary7289
@sourabhchoudhary7289 3 жыл бұрын
we are using two arrays of size n1 and n2 that is n1+n2=n. so basically we are using O(n) extra space that is equal to one array of size n.
@MohammadKhan-ld1xt
@MohammadKhan-ld1xt 3 жыл бұрын
how?
@yashvats824
@yashvats824 2 жыл бұрын
@@MohammadKhan-ld1xt #include using namespace std; void merge(int a[],int s,int m,int e) { int temp[e-s+1]; int p1=s; int p2=m+1; for (int i=0;im) { temp[i]=a[p2]; p2++; } else if (p2>e) { temp[i]=a[p1]; p1++; } else if (a[p1]>n; int arr[n]; for (int i=0;i>arr[i]; merge_sort(arr,0,n-1); for (int i=0;i
@rohandhale9766
@rohandhale9766 Жыл бұрын
Best explaination Of Logic And TimeComplexity
@leenagupta7801
@leenagupta7801 3 жыл бұрын
wow... Nicely explain....
@subratakundu732
@subratakundu732 3 жыл бұрын
Thanks didi for good explanation with less time.
@sjr2001
@sjr2001 3 жыл бұрын
In the int main func when we write mergesort func then copy of arr should be sent . Then how does the sorted array got print by for loop not original array ???
@aayushsharma5133
@aayushsharma5133 3 жыл бұрын
Super animation🔥🔥
@sakshidurve1211
@sakshidurve1211 3 жыл бұрын
merge function is not only to to merge 2 arrays, its is also to sort and merge
@sohammukherjee_2193
@sohammukherjee_2193 3 жыл бұрын
But in which portion is the sorting occuring???
@cswd428-yaswanth3
@cswd428-yaswanth3 3 жыл бұрын
@@sohammukherjee_2193 in the merge fn
@UIEC_MANESH_RAM-tb1hb
@UIEC_MANESH_RAM-tb1hb 3 жыл бұрын
your absolutely right and maybe didi missed it
@AmanKumar-nb4oh
@AmanKumar-nb4oh 2 жыл бұрын
Yeah u can say like that while merging we sort them first
@Special_moment_
@Special_moment_ Жыл бұрын
very good explanation . I really enjoyed.
@technicalknowledge9080
@technicalknowledge9080 3 жыл бұрын
Bhaiya this code is working correctly only for the input (5,4,3,2,1) while we are changing this input then this code is not giving the correct output so please look into this matter. and please highlight this comment so that bhaiya can read this comment Thank you
@rishankbhatnagar6560
@rishankbhatnagar6560 3 жыл бұрын
mera bhi output nahi aa raha hai
@divyangbhamat1228
@divyangbhamat1228 3 жыл бұрын
Yes same problem anyone found solution so please help
@sohammukherjee_2193
@sohammukherjee_2193 3 жыл бұрын
Bro which part sorts the arrays of size n1 and n2???
@irshadali-xx1ms
@irshadali-xx1ms 3 жыл бұрын
#include #include using namespace std; void merge(int arr[],int l,int mid,int r) { int n1=mid-l+1; int n2=r-mid; int a[n1]; int b[n2]; for (int i = 0; i < n1; i++){ a[i]=arr[l+i]; } for ( int i = 0; i < n2; i++){ b[i]=arr[mid+1+i]; } int i=0; int j=0; int k=l; while (i
@technicalknowledge9080
@technicalknowledge9080 3 жыл бұрын
@@irshadali-xx1ms thank you bhai 😀😀
@abdulkareemabid2132
@abdulkareemabid2132 3 жыл бұрын
kal exam hai aur bahi kasam se iss se jayada madad mujhe kine nahi ke thanks a lot sis
@harshal.rathore
@harshal.rathore 3 жыл бұрын
there could be a much better explanation the animation didn't help much in understanding the flow of whole code
@sambhavgandhi6553
@sambhavgandhi6553 3 жыл бұрын
true
@shahriar5570
@shahriar5570 4 ай бұрын
Give me a video link if you found a better explanation for the code.. I actually need it
@mallikarjunpidaparthi
@mallikarjunpidaparthi 4 жыл бұрын
Excellent and clear explanation. Thank you.
@pankaj.yadav1
@pankaj.yadav1 3 жыл бұрын
Ma'am bhut axa smjhati h
@aswinbarath
@aswinbarath 4 жыл бұрын
🔥🔥🔥Verithanam🔥🔥🔥
@harshitnema4197
@harshitnema4197 3 жыл бұрын
For those who are having doubt in line of code where: n1 = mid-l+1; see initially we have given l = 0, r = 7 in the array of length 8. then we will get mid = (l+r)/2 as (7+0)/2 = 3; so n1 = mid - l +1; will be 3 - 0 + 1 = 4;
@harshitnemaa
@harshitnemaa 3 жыл бұрын
If you guys have any doubt you can reply to this comment.
@shubhammahakal1817
@shubhammahakal1817 2 жыл бұрын
Here, mid is pointer and n1 is length from 0 to 3 (0,1,2,3)
@anantsinghal3180
@anantsinghal3180 4 жыл бұрын
Please upload web development course...🙏🏻🙏🏻
@nikunjjain5212
@nikunjjain5212 4 жыл бұрын
@Nikunj Manhas thanks Nikunj 😂
@Tenohekabanzai
@Tenohekabanzai 3 жыл бұрын
if this programme was Apple, Neha maam would be Siri We want Neha maam in all videos :) :) :)
@PulkitMalhotra
@PulkitMalhotra 4 жыл бұрын
1no. Content 🔥
@khuramkhalid5396
@khuramkhalid5396 11 ай бұрын
THANK YOU SO MUCH!!
@mdminhaj8567
@mdminhaj8567 3 жыл бұрын
Thank you so much sister for your informative speech.
@faizansaqeeb3390
@faizansaqeeb3390 3 жыл бұрын
Amazing👍😍🤩
@tarun-prakash
@tarun-prakash 2 жыл бұрын
AMAZING ROCKET SCIENCE
@avijitdey6998
@avijitdey6998 2 жыл бұрын
Great explanation maam, it's clear all of my doubts
@dhobi-the-tiger-69
@dhobi-the-tiger-69 2 жыл бұрын
Love dey. 🤡
@vaibhav7453
@vaibhav7453 5 ай бұрын
Take input from user
@govindjangra600
@govindjangra600 2 жыл бұрын
can anyone tell the problem that i faced in running the same code in the video my output is 5 2 5 5 5
@nishantyadav7461
@nishantyadav7461 3 жыл бұрын
Aman bhaiya ❤️❤️❤️❤️❤️❤️ I want to know the concept of Int**arr =new*arr
@vrajeshmodi4928
@vrajeshmodi4928 3 жыл бұрын
if you want to pass 2D array in any function you have to assign int** arr /*pointer*/ = new *[n] /* your main arr of size n */;
@subhammishra316
@subhammishra316 3 жыл бұрын
@@vrajeshmodi4928 thanx bro
@yogendrarajput5929
@yogendrarajput5929 2 жыл бұрын
Test Cases Not included-- Code is Below---> void merge(int input[], int low, int mid, int high){ int b[high-low+1]; int l1=low,l2=mid+1,i=0; while(l1
@krishnaanasurya3549
@krishnaanasurya3549 Жыл бұрын
Thx for Desi explanation , Ghusenge ghusenge...
@anuragtyagi1111
@anuragtyagi1111 3 жыл бұрын
When God come to help poor students ❤️
@lakshtrivedi004
@lakshtrivedi004 4 жыл бұрын
Can we get backtracking part 2?
@cmcatholic1798
@cmcatholic1798 3 жыл бұрын
Mergesort() function seems bit odd for me, since there is no returning statement🤔. I think it should return 0 at end
@zubinshah4589
@zubinshah4589 3 жыл бұрын
its a void function bro
@praveenawesome2182
@praveenawesome2182 3 жыл бұрын
well yes but actually no !! Firstly mergesort is a void function so it should not return anything but let's say if it wasn't a void function and something happened in the function but it doesn't return anything,in that case, no one knows for sure what will happen. The program may or may not run i.e it can result in a crash so to avoid that situation we always have return statements even after giving a return in a conditional statement inside a function.
@praveenawesome2182
@praveenawesome2182 3 жыл бұрын
ps: I am not sure if the above claim made by me is totally correct and maybe there is good logic behind it, suggestions will be appreciated.
@gauravupreti9340
@gauravupreti9340 3 жыл бұрын
there are two ways in which a function frame can be destroyed, either if return statement is encountered or if nothing is left in function. Try to think with a stack diagram. Hope it will help.
@harshdeep7312
@harshdeep7312 3 жыл бұрын
@@praveenawesome2182 definitely u r correct i encounter many time no output wthout return statement bt after return statement program gives correct output
@zackcarl7861
@zackcarl7861 2 жыл бұрын
What does( mid-l+1 ) mean how can I substrate l from mid
@himanshuwarkade4318
@himanshuwarkade4318 2 жыл бұрын
As l always starts from 0. Suppose the value of Mid is 3 so "3-0+1" is equal to 4 which should be the size of first part of the array.
@priyanshuhazarika9968
@priyanshuhazarika9968 3 жыл бұрын
A smaller function is below. merge function is reduced void merge(int arr[], int l, int mid, int r) { int n1 = mid - l + 1; int n2 = r - mid; // different from video --> one extra element int a[n1 + 1]; int b[n2 + 1]; //maximize the extra element a[n1]=INT_MAX; b[n2]=INT_MAX; for (int i = 0; i < n1; i++) { a[i] = arr[l + i]; } for (int i = 0; i < n2; i++) { b[i] = arr[mid + 1 + i]; } int i = 0; int j = 0; int k = l; // different from video --> using or ( || ) while (i < n1 || j < n2) { if (a[i] < b[j]) { arr[k] = a[i]; k++; i++; } else { arr[k] = b[j]; k++; j++; } } }
@zackcarl7861
@zackcarl7861 2 жыл бұрын
What is array size (mid-l+1)
@amitkumarlkr
@amitkumarlkr 2 жыл бұрын
Int arr ko apne void function me kaise change kar diya array ka to sirf value jata hai nai dusre function me ????
@rohitsaini7427
@rohitsaini7427 3 жыл бұрын
Isn't the L pointer going to be zero and in what case it will be non zero?
@coder9009
@coder9009 3 жыл бұрын
Thanks a lot for this video
@ishitabisaria6437
@ishitabisaria6437 4 жыл бұрын
Sir notes of this lecture??
@AG-kw1rb
@AG-kw1rb 4 жыл бұрын
Bhaiya Please upload the NOTES OF LECTURE 31 - Strings in c++
@aadityasharma6855
@aadityasharma6855 3 жыл бұрын
Its 13
@AG-kw1rb
@AG-kw1rb 3 жыл бұрын
@@aadityasharma6855 Its Lecture 31
@AG-kw1rb
@AG-kw1rb 3 жыл бұрын
@@saimadhumita2144 yeah
@AG-kw1rb
@AG-kw1rb 3 жыл бұрын
Thank you Aman Bhaiya and Apna College team as now the Notes of Stings in C++ are uploaded
@jyothishkamal8255
@jyothishkamal8255 3 жыл бұрын
Suggestion: please use comments to explain what the variables are
@kimjongun2217
@kimjongun2217 4 жыл бұрын
Thumbnail dek k hi samj aa gya🔥🔥🔥
@felizmonk5383
@felizmonk5383 2 жыл бұрын
Don't we have to take dynamic temp array in merge function. Why didn't you get errors?
@VishalGupta-oh7mb
@VishalGupta-oh7mb 2 жыл бұрын
space complexity ne allow kr dia On ko isl;ie
@virendraverma5855
@virendraverma5855 10 ай бұрын
Function Mergesort how it working samajh nahi aaya
@vatsalpoddar6660
@vatsalpoddar6660 2 жыл бұрын
In the Merge function, why did we initialize k with L and not 0
@derekflix
@derekflix 3 жыл бұрын
Kyo karna hai merge sort jab hum pehle hi Selection Sort, Bubble Sort aur Insertion Sort padh chuke hai ????
@mansoorahmad5774
@mansoorahmad5774 3 жыл бұрын
Due to time Complexity. Most efficient sorting technique as compared to others.
@vibhashkumar5554
@vibhashkumar5554 4 жыл бұрын
Only legends know video length is 17:10 ,before the video premiere
@niladriroy1665
@niladriroy1665 4 жыл бұрын
Kaise bata rha hai bhai tu?
@mohammadejaz540
@mohammadejaz540 4 жыл бұрын
Kaise?
@II_xD_II
@II_xD_II 4 жыл бұрын
define "legend"
@neerajkrishnan8574
@neerajkrishnan8574 4 жыл бұрын
@@II_xD_II map ke icons ko identify krne waaala chart lol
@imranimmu4714
@imranimmu4714 3 жыл бұрын
expecting better explanation for time complexity
@ambujsharma7642
@ambujsharma7642 25 күн бұрын
Could you please explain merge sort example with ecmascript 6
@AkashKumar-lg5po
@AkashKumar-lg5po 3 жыл бұрын
You beat Abdul Bari explanation . Wowwwww
@RudranshSharma
@RudranshSharma 3 жыл бұрын
Backtracking ke baad toh kuch samajh nhi aa raha!! What to do?? Ek baar poora course dekhlu aur uske baad phirse dekh lunga..... Yaa fir abhi poora concept clear karte huye chalu?
@strokeadda01
@strokeadda01 3 жыл бұрын
Bhai clear krta chal abhi se wrna pura dekhne tkk itna frustrate ho jaega ki kr nhi paega🤐
@thetypicalone2525
@thetypicalone2525 3 жыл бұрын
Sorry ur eplanation was right ,😙😙😙😙😙😅😅😅👍👍👍👌I was doing in the wrong way
@rexstark5319
@rexstark5319 3 жыл бұрын
Why do u not get errors, even if u declare size of arrays as variables at runtime
@paramrajsinghchadha1957
@paramrajsinghchadha1957 3 жыл бұрын
varies from compiler to compiler
@dibyarupnath
@dibyarupnath 3 жыл бұрын
you need to declare and take input the variable, which you use as the size of the array, while declaring the array.
@rishabarya1379
@rishabarya1379 2 жыл бұрын
THEY SKIP TO THE PART WHEN CODE IS RIGHT YOU CAN SEE IT FOR YOURSELF EXAMPLE THE VEDI THEY TYPE "mergeSort(arr,0,4);" BUT AFTER EXECUTION WHEN YOU CAREFULLY LOOK IT IS SUPPOSED TO BE " mergeSort(arr,0,5);"
@twodimensions459
@twodimensions459 2 жыл бұрын
This code is not fully optimized.. it is showing time limit exceeded
@dhairyashah5886
@dhairyashah5886 3 жыл бұрын
classic video!!!!!
@chanduchandrakanth5131
@chanduchandrakanth5131 3 жыл бұрын
Is mergesort sort itself
@vinayakjalan5696
@vinayakjalan5696 4 жыл бұрын
Didi iss lecture ke notes add kardo description box main .. Woh blank reh gaya hh
@alpha183_i
@alpha183_i 9 ай бұрын
Thank you mam
@kartikey14
@kartikey14 3 жыл бұрын
aced it...!!❤
@SobhitPanda
@SobhitPanda 3 жыл бұрын
Sir, time complexity nahi samjh aai? Please elaborate, the procedure. Or please suggest some materials to practice from.
@sachinbairi6353
@sachinbairi6353 3 жыл бұрын
Are voh keh raha hai ki humne pehele n length ki array ko divide kiya half mai toh hum abb left array ko sort karne ko humko t(n/2)time lagega some for the right half of that array jab hum dono side ko plus karenge tab yee ayega -->>> i.e. t(n) = t(n/2)+t(n/2) = 2t(n/2) but hum divide karne ke baad merge bhi kar rahe hai toh usko humko merge karne ko linear time lagega i.e 'n' toh final recurrence relartion atta hai ki t(n) = 2 t(n/2) + n ...eq1 yee aaya hai for the first split jo humne kiya n ko n/2 mai but hum mergeSort mai we divide the input list of length n in half successively until there are n lists of size 1. so, if humko left or right half of the array ke liye recurrence relation chahiye toh follow same procedure but iss baar n half hai. replace n by n/2 in the eq 1
@hrithikjaysingpure9623
@hrithikjaysingpure9623 3 жыл бұрын
@@sachinbairi6353 thnx bro
@shamshuddinshaikh4774
@shamshuddinshaikh4774 3 жыл бұрын
@@sachinbairi6353 tumne toh bade acche se samjhaya bro
@anaskaratela7171
@anaskaratela7171 3 жыл бұрын
any better approach than this while using functions in recursive way??
@deepjyotikoley8499
@deepjyotikoley8499 3 жыл бұрын
for better time complexity use quick sort
@gourav7921
@gourav7921 3 жыл бұрын
Int n1 = mid - l + 1 Didi ne 8:24 par (mid - l )mein 1 kyo plus Kiya hai agar kisi Ko iska reason pta hai toh pls jrur btana
@puneetfanspage
@puneetfanspage Жыл бұрын
ma you telling the code in right way but you don't understand us the clear topic when you teach us that in merge function that int n1= mid-l+1 you just telll us but you don't cleariy that so please understand this song this is the feed back of all video because you doing same mistake all in this video i'm not blame you i appreciate your experience but please ensure that before teaching that are this topic is really i know and i will teach this with very clearification thanks mam for this code
@Dont_know_wt
@Dont_know_wt 3 жыл бұрын
Mam u r keep saying pointer.. Is that pointer or index? Bcz pointer should have Asterix(*) sign
@harshitrathi3077
@harshitrathi3077 3 жыл бұрын
Aree Bro Pointer Doesn't Only Means That U have To Take a * Sign , Pointer also Means To Pointing something
@Dont_know_wt
@Dont_know_wt 3 жыл бұрын
@@harshitrathi3077 acha
@subodhsingh9287
@subodhsingh9287 2 жыл бұрын
when 2 and 8 are merged then we should get 8 and 2 .RIGHT??? but slides shows 2 and 8 at 3:18
@animegod5295
@animegod5295 3 жыл бұрын
why is it showing expression must have a constant value while declaring temp array? pls help somebody
@_rahulsain
@_rahulsain 4 жыл бұрын
animation se time complexity smj aaygi
@mancunianswagger3668
@mancunianswagger3668 3 жыл бұрын
It is important for us not gonna lie but this is hard. If it wasn't this important most of us would've skipped this right???
@darshantrivedi5390
@darshantrivedi5390 4 жыл бұрын
Thanks 🔥☺️
@bhimashankarhalasage2267
@bhimashankarhalasage2267 3 жыл бұрын
Why we passing mid to merge?
@iffattuli8676
@iffattuli8676 3 жыл бұрын
Thanks! :)
@rivines
@rivines 3 жыл бұрын
Ma'am aap thoda tez bolti to shi rhta
@oqant0424
@oqant0424 3 жыл бұрын
thanx a bunch
@hemant-li1gp
@hemant-li1gp Жыл бұрын
in mergeSort function we pass arr of main function by value, then how did this changed the array in main function
@StoryGicRohit
@StoryGicRohit 3 жыл бұрын
shukriya
@sabyasachidas4572
@sabyasachidas4572 2 жыл бұрын
Can you just tell me why n1=mid-l+1??
@patil_ji
@patil_ji 2 жыл бұрын
getting output only when I give input as same you have given but whenever I change my input array sequence or give a sorted array as input code is not working
@djpro6413
@djpro6413 2 жыл бұрын
mam we have to lesan the synatx of code of n1 and n2 otherwise how this logic is made😡 😡
@rewatkarshiven675
@rewatkarshiven675 Ай бұрын
what is the logic of n1=mid-l+1
Quick Sort | Code and Explanation | C++ Course - 19.2
15:24
Apna College
Рет қаралды 396 М.
Merge Sort | For Beginners | Java Placement Course
21:25
Apna College
Рет қаралды 705 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 3,2 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 66 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 149 МЛН
Learn Merge Sort in 13 minutes 🔪
13:45
Bro Code
Рет қаралды 334 М.
Lecture35: Merge Sort using Recursion | Day-5 | 10 Day Recursion Challenge
24:23
Are you a buffalo? |  Stand up comedy by Manik Mahna
16:27
Manik Mahna
Рет қаралды 906 М.
How Merge Sort Works?? Full explanation with example
9:52
Gate Smashers
Рет қаралды 833 М.
Learn Selection Sort in 8 minutes 🔦
8:21
Bro Code
Рет қаралды 260 М.
2.7.2.  Merge Sort Algorithm
24:07
Abdul Bari
Рет қаралды 1,7 МЛН
Merge sort algorithm
18:20
mycodeschool
Рет қаралды 2,2 МЛН
MergeSort Sorting Algorithm in Hindi
35:34
CodeWithHarry
Рет қаралды 326 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 3,2 МЛН