mergesort

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ย. 2024

ความคิดเห็น • 14

  • @pgudipati555
    @pgudipati555 7 ปีที่แล้ว +5

    Just wondering, where can I find the lecture-handout (PDF) of this lecture, for download?

  • @ayushganguli1359
    @ayushganguli1359 5 ปีที่แล้ว +5

    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

  • @bejorrani
    @bejorrani 2 ปีที่แล้ว +5

    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

  • @RA-oo4lj
    @RA-oo4lj 5 ปีที่แล้ว +1

    Best explanation ever!

  • @sasikumar6378
    @sasikumar6378 5 ปีที่แล้ว +2

    Explain ,if right - left

    • @vaishnaves1723
      @vaishnaves1723 4 ปีที่แล้ว +4

      So right and left are indices right? right - left

    • @arungandhi5612
      @arungandhi5612 4 ปีที่แล้ว +1

      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

    • @sanketargade3685
      @sanketargade3685 3 ปีที่แล้ว

      @@vaishnaves1723 how can i consider no element either ther is 3 is present or 2 element is present(3,4)

  • @keshavmaheshwari6420
    @keshavmaheshwari6420 4 ปีที่แล้ว +1

    If I give input list 38 27 43 3 9 82 10
    The output I get is 3 9 38 27 43 82 10

    • @exploringMyself998
      @exploringMyself998 4 ปีที่แล้ว +1

      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.

  • @nikhilpatil2482
    @nikhilpatil2482 4 ปีที่แล้ว +1

    1st method is cool but second is .......................

  • @Itsmethanu....-_1320
    @Itsmethanu....-_1320 2 หลายเดือนก่อน +1

    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