Shell sort example | Insertion | Data Structures | Lec-58 | Bhanu Priya

Поделиться
HTML-код
  • Опубликовано: 7 окт 2024
  • Insertion : shell sort algorithm , example & analysis

Комментарии • 124

  • @Rohit-km8il
    @Rohit-km8il 3 года назад +53

    You have not explained properly when it comes to pass=2, you did not explain how swapping took place to ultimately get the sorted values in pass = 2.. I wil not be able to code with your current explanation

    • @yogeshrajbanshii
      @yogeshrajbanshii Год назад

      insertion sort is used bro

    • @SahdevSingh-io3qp
      @SahdevSingh-io3qp 8 месяцев назад +2

      Why the fuck we are using this shell sort, when we ultimately have to perform insertion sort at gap 1 that is original insertion sort

  • @jonwinder1861
    @jonwinder1861 5 лет назад +38

    EVERYONE WHO IS Still CONFUSED HERE IT IS IN A NUTSHELL:
    For the first pass (when n/2 =5), the first element is compared to the element ahead by five subscripts. This is done five times(So, for the second time for example, element 1 is used, and compared with the element 5 subscripts ahead of that, and so on).then after the swaps If they are necessary, it will start out at the zero index again for pass 2(5/2 is 2.5 of course there isn’t 2.5 gap of subscript just int part). The zero index and the index two subs ahead of that gets evaluated 8 times. Cause the amount of rounds in the pass in the for loop is determined by pass < total elements (10). Then the swaps are made here. Then the last pass is 2/2 = 1. 1 0; gap /= 2), forlooptwo(i = gap; i < n; i++), for loop three (j = i - gap; j > 0 && (s[j] > s[j+gap]) if so.... { do bubble sort shit but not with adjacent elements)

  • @islamicpoints4703
    @islamicpoints4703 5 лет назад +2

    Thank u so much ma'am really Thanks.. Samjh nai aaa raha thaa kisi ka b apka channel open kia clearify ho gaya 100%...

  • @pradeep_18_
    @pradeep_18_ 3 месяца назад

    Thanks mam i have understand very easily when compared to other channels

  • @demotv7852
    @demotv7852 5 лет назад +3

    Thank you. You made it very simple. I got it.

  • @swatirauniyar9062
    @swatirauniyar9062 5 лет назад +13

    Why did you use "selection sort" in pass 2?
    Anyway explanation is good 👍

  • @rajatkumar5374
    @rajatkumar5374 3 года назад +1

    Bahut Sochne ke baad ab lagta h Subscribe karna hi padega... Badi kaam ki chiz h aapke sabhi lecture 👌👌Kar diya Subscribe maine

  • @coursetotal6570
    @coursetotal6570 3 месяца назад

    very good and energetic explanation until the end of the viedo. thank you

  • @ishanibanerje
    @ishanibanerje 5 лет назад +1

    Nice way to make someone understand...thanks a lot for the vedio

  • @hrushikeshmandekar6572
    @hrushikeshmandekar6572 6 лет назад +3

    Thank you so much.. I finally understand this hole concept thank you so much... Go bless u👍👍👏👏👏👏🙏🙏🙏🙏💟

    • @_aka5h
      @_aka5h 2 года назад

      hole concept 💀

    • @ak689
      @ak689 Год назад

      @@_aka5h also go bless you💀

  • @foodlover3128
    @foodlover3128 5 лет назад +11

    I think pass 2 is incorrect

  • @sharanya1
    @sharanya1 3 года назад +1

    Thank you so much Mam
    U taught really well

  • @ahmadnayeem9587
    @ahmadnayeem9587 Год назад +3

    I don't understand : for phase-2 red coloured(2nd iteration), why you compare all the elements at once unlike previous iteration(green)??

  • @sadiyabanu221
    @sadiyabanu221 Год назад +1

    Thank you so much Mam.

  • @holayey95
    @holayey95 3 года назад +1

    Thanks Ma'am

    • @ytg6663
      @ytg6663 2 года назад +1

      Welcome my child

    • @holayey95
      @holayey95 2 года назад

      @@ytg6663 😌

  • @sivaharinis3916
    @sivaharinis3916 5 лет назад +2

    Thank you so much. You made it simple. Got it.

  • @PriyaDharshini-ns4tg
    @PriyaDharshini-ns4tg 5 лет назад +6

    Pass 2 y we are comparing all values

  • @iamajaxy
    @iamajaxy 4 года назад +1

    Very well explained thanks

  • @imanbohara658
    @imanbohara658 Год назад +1

    Why Pass 1 pass 2 distinct very confusing😢 9:15

  • @yashvardhansingh473
    @yashvardhansingh473 4 года назад

    Cleared my doubt easily..thanks

  • @KrishnaBawane
    @KrishnaBawane 6 лет назад +1

    Thank you mam.....
    You explained beautifully....
    Thanks for your help...

  • @aliyaa5008
    @aliyaa5008 2 года назад

    Thank you for this Worth class.. Keep going

  • @rumanzahid6671
    @rumanzahid6671 5 лет назад +1

    Jazak Allah Madam G.

  • @SelinG-l1m
    @SelinG-l1m 6 лет назад +7

    Idk Why But i really enjoyed her saying „ok“ it was kinda cute haha

  • @reminrajesh9780
    @reminrajesh9780 5 лет назад +1

    Wonderful explanation

  • @rajankhunt7002
    @rajankhunt7002 2 года назад

    Thank you good explanantion

  • @maharshpatel5727
    @maharshpatel5727 5 лет назад +10

    the above algorithm is completely wrong
    it doesn't work for the array = {21,7,15,94,36,58,23,7,11}

  • @amenaraafia948
    @amenaraafia948 5 лет назад +3

    Seriously amazing explanation!

  • @38-suhaibhashmi24
    @38-suhaibhashmi24 5 лет назад +1

    If the number of elements is odd ...means gap is 7 or 9

  • @vageeshanvageesh5583
    @vageeshanvageesh5583 4 года назад

    ultimate, nantri akka....

  • @barathkumarg9197
    @barathkumarg9197 3 года назад

    thankyou mam saved my sem

  • @johndavidfajardo5432
    @johndavidfajardo5432 Год назад

    Thank youuu!

  • @jeereddyganeshreddy1727
    @jeereddyganeshreddy1727 4 года назад +1

    5:19 mam after checking if one element remains in the list without pair what we want to do?🤔 Pls answer me mam...

  • @sagarmarshettiwar3548
    @sagarmarshettiwar3548 4 года назад

    Mam you are so creative😍🙂

  • @noorulainrana124
    @noorulainrana124 2 года назад

    Thank u

  • @aliansar3673
    @aliansar3673 3 года назад

    Thanku

  • @012dineshr3
    @012dineshr3 2 года назад

    Mam your explaining method is very easy to absorb it thank u mam,

  • @nijatullahmansoor4686
    @nijatullahmansoor4686 3 года назад

    thank you miss

  • @abhishekjaiswal6492
    @abhishekjaiswal6492 3 года назад

    Great explanation mam... Keep it up..

  • @onlyfacts4604
    @onlyfacts4604 9 месяцев назад

    understood

  • @kadithampallimadhu9654
    @kadithampallimadhu9654 5 лет назад

    Thanks sister

  • @deveshgolwalkar3605
    @deveshgolwalkar3605 4 года назад

    very well explained!!

  • @snehashetty6705
    @snehashetty6705 Год назад

    N=7/2 how to write the array

  • @gaurab_69
    @gaurab_69 5 лет назад

    thanks priya ...

  • @AllBasicClearStudyguide
    @AllBasicClearStudyguide 4 года назад

    Thanku Ma'am

  • @umarfaruk4019
    @umarfaruk4019 6 лет назад +1

    mam you can make a video on shell sort code in c/c++

  • @sivagamimurugesan5541
    @sivagamimurugesan5541 5 лет назад

    Super explanation thank you plz mention the best case sorting the list...

  • @bharghavij2986
    @bharghavij2986 3 года назад

    Don't we need to swap in pass 2 ?

  • @jaredwang3336
    @jaredwang3336 Год назад

    great explanation! Helps a lot!

  • @dronalbhardwaj
    @dronalbhardwaj 2 года назад

    You can also provides the notes which you write while explaining, in the description.

  • @shreyasahani472
    @shreyasahani472 3 года назад +1

    Very well explained ma'am thank you ♥️

  • @monikasalame4080
    @monikasalame4080 6 лет назад

    Thank you mam...... Explanation is very good

  • @rajpalsinhrajput1757
    @rajpalsinhrajput1757 6 лет назад

    Thank you sooo much dear, you are such a good learner, keep it up and create new video for all shorting, u solve my confusion about this short, thank you so much again

    • @kurobros4791
      @kurobros4791 6 лет назад +1

      Short oh yea.... Haha, learn English before learning how to code

  • @rohithrajeevsythana45
    @rohithrajeevsythana45 6 лет назад +1

    replace 70 with 78 solve .The final answer will not be in a sorted order .

  • @pushpacookinghome5414
    @pushpacookinghome5414 3 года назад

    How would we solve for gap 3

  • @WalkenHub
    @WalkenHub Год назад

    what is floor in gap formula

  • @ganeshkumarreddy3804
    @ganeshkumarreddy3804 5 лет назад

    Tq mam

  • @aftabahmed9780
    @aftabahmed9780 2 года назад

    This is final ans is case 3 ?

  • @varma8114
    @varma8114 4 года назад

    In pass 2 you arranged from least to large why you have done that in pass 1 u said to change only the n elements with normal element

  • @darshanau3060
    @darshanau3060 2 года назад

    Super mam explain heap Sorting please

  • @dharmaraj4537
    @dharmaraj4537 5 лет назад

    Nice 👍👍👍 well explained

  • @shivanshutiwari5646
    @shivanshutiwari5646 4 года назад +4

    pro tip- watch in 2x speed

  • @kinnereshmotumarri430
    @kinnereshmotumarri430 4 года назад

    Mam plz explain radix sort

  • @lulllife108
    @lulllife108 5 лет назад

    Nice video mam

  • @shobhabai606
    @shobhabai606 5 лет назад +23

    Pass2 need to explain more properly

    • @abderahmaneaoufi
      @abderahmaneaoufi 5 лет назад +4

      exactly i didn''t understaand it

    • @chamuchamu2550
      @chamuchamu2550 5 лет назад +1

      Yeah! with atleast one more example.

    • @saqibbhat4328
      @saqibbhat4328 5 лет назад

      @@chamuchamu2550 it is easy dear

    • @nishantraj4614
      @nishantraj4614 5 лет назад +1

      If you know insertion sorting then it will be easy to understand.
      Here at pass2, we are doing insertion sort with alternate elements i.e. gap = 2.
      I think you got it.

    • @SVTechno
      @SVTechno 5 лет назад +2

      @@saqibbhat4328 nhi degi

  • @sichumaharjan1638
    @sichumaharjan1638 6 лет назад

    Thank u so much it was so helpful 😄

  • @sarveshmaurya2168
    @sarveshmaurya2168 2 года назад +1

    in pass 2 you seems to be confused

  • @shagunaroraarora9367
    @shagunaroraarora9367 5 лет назад

    thanku mam
    nice explaination4

  • @manastripathi1157
    @manastripathi1157 2 года назад

    pass 2 doesnt make sense..its different from whats done in pass 1 and 3..similar to selection sort

  • @preethamhd3613
    @preethamhd3613 4 года назад

    what if the N=11 then floor(11/2)=5.5 and should we take gap as 5 or 6 ?

    • @varma8114
      @varma8114 4 года назад

      Floor means to take least value ceil for max value

  • @prashanthshukla1403
    @prashanthshukla1403 5 лет назад

    In pass 2 from where 80 comes

  • @vimala8833
    @vimala8833 5 лет назад

    I understood well
    Thx sister

  • @Learn_With_Aarvi
    @Learn_With_Aarvi 4 года назад

    pass 2 is confusing.....

  • @apaarmaheshwari8673
    @apaarmaheshwari8673 5 лет назад

    are used to *sort the data.

  • @ParnikaTutorials
    @ParnikaTutorials 4 года назад +1

    It is wrong process.

  • @ericsharma2606
    @ericsharma2606 6 лет назад +4

    You took a big short cut in middle of the video, but good video after all

    • @jonwinder1861
      @jonwinder1861 5 лет назад +2

      EVERYONE WHO IS Still CONFUSED HERE IT IS IN A NUTSHELL:
      For the first pass (when n/2 =5), the first element is compared to the element ahead by five subscripts. This is done five times.then after the swaps If they are necessary, it will start out at the zero index again for pass 2(5/2 is 2.5 of course there isn’t 2.5 gap of subscript just int part). The zero index and the index two subs ahead of that gets evaluated 8 times. Cause the amount of rounds in the pass is determined by pass < total elements (10). Then the swaps are made here. Then the last pass is 2/2 = 1. 1

  • @hemanthpeddi4129
    @hemanthpeddi4129 4 года назад

    pass 2 is wrong

  • @saqibbhat4328
    @saqibbhat4328 5 лет назад

    👌👌

  • @dreammotivationalvideo4591
    @dreammotivationalvideo4591 3 года назад

    Maam aap ne algo nahi btai

  • @ibrahimamin646
    @ibrahimamin646 5 лет назад

    wish you were my teacher!

  • @amaliaafiqah9425
    @amaliaafiqah9425 5 лет назад

    i'm sorry but how if the N is odd?

  • @aradhanasaxena8561
    @aradhanasaxena8561 5 лет назад +3

    Waste of time seriously

  • @pawanchoure1289
    @pawanchoure1289 5 лет назад

    Welcome back 😁

  • @vinodjaiswal972
    @vinodjaiswal972 4 года назад

    mam are u phd? or Mphil

  • @sumitvyas290
    @sumitvyas290 5 лет назад

    Nic

  • @udaygowda6638
    @udaygowda6638 4 года назад

    Radix sort and shell sort is same or different mam

  • @bat_man1138
    @bat_man1138 3 года назад

    It is wrong...

  • @rohitrocky3827
    @rohitrocky3827 5 лет назад +1

    What if N is a odd number....???..
    Anyone..🤔

    • @varma8114
      @varma8114 4 года назад +1

      Just know what is floor and what is ceil
      If n is 7 then it becomes 3.5 right if you use floor then value is 3 if you use ceil then value is 4 that's it

  • @dipanshunegi9805
    @dipanshunegi9805 5 лет назад

    if you would be near me .. i would gift you a chocolate.. thankss... very nice explaination

  • @architchopra9559
    @architchopra9559 4 года назад

    1 2 3 4 5 sayy with me

  • @S__DhruvTrehan
    @S__DhruvTrehan 2 года назад

    no clarity in explaination.

  • @amishdotcom
    @amishdotcom 5 лет назад

    For latest lyrics goto www.baebom.com

  • @KaifKhan-yj4yf
    @KaifKhan-yj4yf 11 месяцев назад

    226k views for what ? Above algorithm is wrong. Viewers please watch other videos. She is misleading

  • @ayushaggarwal4714
    @ayushaggarwal4714 4 года назад

    its wrong u should remove this video

  • @sanjogdash
    @sanjogdash 6 лет назад +1

    same old classroom teaching. Face palm.

  • @anikmahmud5957
    @anikmahmud5957 5 лет назад +3

    i think pass 2 is incorrect

  • @tamilselvans6010
    @tamilselvans6010 5 лет назад

    Tq mam

  • @Jagadishkumar4646
    @Jagadishkumar4646 4 года назад

    Pass 2 is wrong

  • @adityapratapsingh4776
    @adityapratapsingh4776 3 года назад

    thanku mam