Merge sort

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • To access the translated content:
    1. The translated content of this course is available in regional languages. For details please visit nptel.ac.in/translation
    The video course content can be accessed in the form of regional language text transcripts, books which can be accessed under downloads of each course, subtitles in the video and Video Text Track below the video.
    Your feedback is highly appreciated. Kindly fill this form forms.gle/XFZhSnHsCLML2LXA6
    2. Regional language subtitles available for this course
    To watch the subtitles in regional languages:
    1. Click on the lecture under Course Details.
    2. Play the video.
    3. Now click on the Settings icon and a list of features will display
    4. From that select the option Subtitles/CC.
    5. Now select the Language from the available languages to read the subtitle in the regional language.

Komentáře • 10

  • @arkadyutipaul246
    @arkadyutipaul246 Před 6 lety +3

    Excellent explanation Sir. Thank you very much.

  • @chatujje27
    @chatujje27 Před 3 lety +1

    Sir, I think you didn't declare or specify the variables L & R.
    Please help me & correct me if I'm wrong.

  • @nachiketshelar8114
    @nachiketshelar8114 Před 7 měsíci

    I just hate it when the course about algorithms has algorithms wrong

  • @vasudev7828
    @vasudev7828 Před 4 měsíci

    This implementation of merge sort throws an out of bounds exception, because it attempt to access A[i] (in case 1) before checking i==m (in case 2). Here's the fixed version:
    int Apos = 0, Bpos = 0;
    for (int i = 0; i < C.size(); i++)
    {
    if (Apos == A.size() || ((Bpos < B.size()) && (B[Bpos]

  • @dhanushsonkusare9623
    @dhanushsonkusare9623 Před 2 lety

    13:05 The merge function is wrong it should be
    Merge(L,mid-left,R,right-left+1,B)

    • @harshjain8354
      @harshjain8354 Před 10 měsíci +1

      Actually, we are assuming that the sorted function applies on array at [ left , ...... , right-1 ]
      Right is not included, Thatswhy!!

  • @saptarshisahoo5075
    @saptarshisahoo5075 Před 4 lety +5

    the merge algorithm is wrong.

    • @q_c9411
      @q_c9411 Před 4 lety +1

      can you corrct it please

    • @shivateja7574
      @shivateja7574 Před 4 lety +1

      Yes Bro.It is wrong.It gives a Index out of Bounds exception.

    • @yojangandha931
      @yojangandha931 Před 3 lety +2

      @@q_c9411 Yes if you require this.