Not the right program sir. I have tried this program several times and it only returns me a singleton list. I guess problem is there in the first if statement in mergesort function
@bejorrani2 жыл бұрын
A shorter Program for Merge Sort. Using recursion without much variables and also usible one of the combine as given in the wrongmergesort program. def mergesort(seq): k=len(seq) if k==1: return seq else: return Merge(mergesort(seq[:k//2]),mergesort(seq[k//2:])) def Merge(seq1,seq2): C,m,n,i,j=[],len(seq1),len(seq2),0,0 while i+j
@pgudipati5557 жыл бұрын
Just wondering, where can I find the lecture-handout (PDF) of this lecture, for download?
@RA-oo4lj5 жыл бұрын
Best explanation ever!
@sasikumar63785 жыл бұрын
Explain ,if right - left
@vaishnaves17234 жыл бұрын
So right and left are indices right? right - left
@arungandhi56124 жыл бұрын
Left Is the first index right is the last index, if left and right are the same then there is only 1 element. If left and right differ by 1 there are 2 elements. So sorting a single element or 2 elements is very is. For eg sort 5 will return 5, and sort 4,5 will return 4,5
@sanketargade36853 жыл бұрын
@@vaishnaves1723 how can i consider no element either ther is 3 is present or 2 element is present(3,4)
@nikhilpatil24824 жыл бұрын
1st method is cool but second is .......................
@keshavmaheshwari64204 жыл бұрын
If I give input list 38 27 43 3 9 82 10 The output I get is 3 9 38 27 43 82 10
@exploringMyself9984 жыл бұрын
Here, he is just merging the two sorted list in a sorted order, but is not using any divide and conquer strategy. For your input write divide and conquer program and then apply merge sort.
@ByteSizeHacks0433 ай бұрын
Worst explanation ever He's assuming everyone know these programs before hand and explaining things without stop not even thinking whether the people watching will understand or not