Sorting Algorithm | Shell Sort – step by step guide



In this video we will learn about Shell Sort algorithm.

Shell Sort Code

Algorithm Playlist

Data Structure Playlist

Heap Sort

Quick Sort

if you find my videos interesting and enjoy watching them then please give a thumbs up, share and subscribe my channel and comment.

click the following link to subscribe my channel

thanks for watching
see you in the next video
stay happy and keep smiling 🙂

Nguồn: https://khudothidongvan.com/

Xem thêm bài viết khác: https://khudothidongvan.com/cong-nghe/

49 Comments

  • Thank you so much for this fantastic explanation!

    Katrine Jensrud
    Posted July 13, 2020
  • If we are going to end up with an Insertion Sort at the last pass anyway, why are we doing this at all? To reduce number of swaps during the Insertion Sort at the end?

    Lakshya Gupta
    Posted July 13, 2020
  • This is the best explanation that I have found of this, thank you for not skiping things, you are awesome!

    Boren Fenix
    Posted July 13, 2020
  • Amazing work man. Your explaination by visualziation helps a lot.

    Waqas Arif
    Posted July 13, 2020
  • Best video on the subject!

    Gabriel Ferreira
    Posted July 13, 2020
  • I don't get it.. after he reaches "end" he goes back to compare other elements before going for pass 2 and 3? What decides that?

    Robin Svensson
    Posted July 13, 2020
  • without sound and still better than my professor with high voice 😛 LOL

    George tannous
    Posted July 13, 2020
  • the best explanation ever.im learning in Chinese and when the lecturer was teaching it was all weird.good video

    Batsirai Chimperu
    Posted July 13, 2020
  • bhai tumne baccha lia ..thanks for this nyc video

    Nipun Aggarwal
    Posted July 13, 2020
  • I searched everywhere. Thank you for this helpful explanation. 🙂
    Note: What helped me understand this is that this works similarly to Insertion Sort.

    Goldfish90
    Posted July 13, 2020
  • Great work!

    Hal Huynh
    Posted July 13, 2020
  • what is "pass" ?

    Saila
    Posted July 13, 2020
  • Thanks a lot.

    Samuele B
    Posted July 13, 2020
  • Without voice ,, wht you explain here clearly… Time wast

    Samad Md
    Posted July 13, 2020
  • 10 free marks….

    Dagim Tadiyos
    Posted July 13, 2020
  • Brother ap ki video boht achi ha pr agar Ap ki voice bhi hoti to zyada Achi tarha samajh ati

    Umar Zafar
    Posted July 13, 2020
  • Thanks. It's clear.

    高维春
    Posted July 13, 2020
  • everyone is doing that fucking algorithm differently

    Sansal Bakkal (Student)
    Posted July 13, 2020
  • Finally I got it😁😁😁

    Cotton Candy
    Posted July 13, 2020
  • 10 minutes to sort an array with n=9? Seems to be a pretty slow algorithm

    SumoLuke
    Posted July 13, 2020
  • please increase the speed of your video and also add sound. But still the algorithm is easy to understand.

    Usama Iftikhar Butt
    Posted July 13, 2020
  • amazing bro

    Usama Iftikhar Butt
    Posted July 13, 2020
  • Very useful video. Thanks Yusuf.

    raji ramesh
    Posted July 13, 2020
  • Great content, easy to understand but it is too quiet 🙂

    Duy Thành Vũ
    Posted July 13, 2020
  • Thank you very much. Great explanation! You could add your voice, too, for a much better result.

    Harun Altay
    Posted July 13, 2020
  • really cool simulation. Thanks for the wonderful video

    Mohan Bhargava
    Posted July 13, 2020
  • can u make a video about hibbard's increment sequence?

    Dark Inferno
    Posted July 13, 2020
  • Thank you this was the only video on youtube where i undestand this sorting algorithm

    Gustavo Vinicius
    Posted July 13, 2020
  • Nicely explained sir, please use voice along with the explanation.

    SIDDHARTH SETHIA
    Posted July 13, 2020
  • Hi, do you mean that it uses the same concept as the BUBBLE sort, rather than the INSERTION sort? These are two different types of sorting methods if I am not mistaken.

    Luke Xuereb
    Posted July 13, 2020
  • Brother I want to learn algorithm, which book is good, please tell me

    Harpreet singh
    Posted July 13, 2020
  • thank you so much

    Glory Tewan
    Posted July 13, 2020
  • java code for shell sort:
    private void shell(int[] a) {
    int n=a.length;
    for(int gap=n/2;gap>0;gap=gap/2) //To create gap and reduce it by half
    {
    for(int i=gap;i<n;i++) // To go though all the element distant at specified gap
    {
    int j;
    int temp=a[i];
    for(j=i;j>=gap&&temp<a[j-gap];j=j-gap) //Element swapping in case of greater element exist prior to smaller element in list
    {
    a[j]=a[j-gap];
    }
    a[j]=temp;
    }
    }

    }

    Amit Varshney
    Posted July 13, 2020
  • thanks, I watched lots of videos but i understand with this video.

    heyad
    Posted July 13, 2020
  • Thank you so much. you made it really easy to understand 🙂

    Vasundhara Bhattacharya
    Posted July 13, 2020
  • This video was so helpful!
    Thanks

    Raphys
    Posted July 13, 2020
  • VISIT HOME PAGE: http://cprogramaboutexample.blogspot.in/
    DATA STRUCTURE: http://cprogramaboutexample.blogspot.in/2017/07/data-structure.html
    BEGINNER PROGRAMMER & COMPUTER SCIENCE STUDENTS FOR

    KARTIK
    Posted July 13, 2020
  • why make a video if not saying anything………we can read from a websitre or book!!!! we come here to get better explanation

    Sudhanshu Shekhar
    Posted July 13, 2020
  • thank you sooo…..! much It was really helpful to study and understood quickly

    Preethi mukund kumaresh
    Posted July 13, 2020
  • Note that the performance of Shell sort depends very much on the gap function used. In the video he uses 2^n as the the gap function which is not a very good function since it compares odd positioned elements only in the end. Better go with Knuth's function (3n – 1) which performs way better than this one.

    Mayur Kulkarni
    Posted July 13, 2020
  • thank u ..
    i implement shellsort method after watching your video ..
    template <typename T>
    void ShellSort(T arr[],int size){
    int gap;
    int firstgap=0;
    int endgap=0;
    gap=floor(size/2); // calc gap
    firstgap=0;
    endgap=gap; // end gap
    int index;
    while (gap>0){ // we will divide gap until gap be less then zero gap=gap/2
    while(endgap<size){ // we increment endgap till reach size
    if (arr[firstgap]>arr[endgap]){ // compare between firstgap and endgap if first bigger swap
    T temp=arr[firstgap];
    arr[firstgap]=arr[endgap];
    arr[endgap]=temp;
    int i=firstgap;
    index=i;
    while (i>=0){ // we still need to compare all otherside gap
    if (arr[i]<arr[index])
    break;
    else if (arr[i]>arr[index]) {
    T temp=arr[i];
    arr[i]=arr[index];
    arr[index]=temp;
    index=i;
    }
    i-=gap;
    }
    }
    endgap++;
    firstgap++;
    }
    gap=gap/2;
    firstgap=0;
    endgap=gap;
    }
    }

    Osman Hadgo
    Posted July 13, 2020
  • perfect!

    Iliana D.
    Posted July 13, 2020
  • I was kind of skeptical when I found out that there were no voice overs. But it turned out fine. Thank you.

    Dean Walker
    Posted July 13, 2020
  • explanation cant be more easier than this. Helpful… thank you so much 🙂

    Sumaiyya Khan
    Posted July 13, 2020
  • Decent. Much better than GeekforGeeks' video. Thanks

    Sina
    Posted July 13, 2020
  • very helpful….thank you so much

    ABHIK BURMAN
    Posted July 13, 2020
  • Man i wish you were my university teachers. Iface a lot of problems in C. Let me know if you can take some online classes.

    Saivarshini Ravi
    Posted July 13, 2020
  • i understood it very clearly and quickly !….thank you sir.

    Tamothar
    Posted July 13, 2020
  • very nice video!!! Explained very well.Please add voice explanation Yusuf .

    Uddiptaa Biswas
    Posted July 13, 2020

Leave a comment