Added: 3 years ago
From: codegearguru
Views: 43,368
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (35)

Sign In or Sign Up now to post a comment!
  • yeah basically in code form this would be the equivalent of creating another array to store the sorted items

  • the video does note move the first element in each iteration to the correct position (min element). For me this looks like that you create a second array where you incrementally insert the min element.

  • yes this helped me understand it, now how do i put it in my program =/

  • It helped with class!

    

  • where is the swap/exchange ?? :O

  • Comment removed

  • If you use first element as the pivot and find the minimum or maximum value? Would be great if you could show this with the cards? Thanks

  • @1nglewattz1 it's "ur" not "your" duhhhhhhhh

  • I think this whole series is so creative and plainly excellent. Now I understand all the tricks in 3 minutes, compared reading confusing texts for hour!

    Good job.

  • Hm, I always thought Selection Sort was done in-place (usually). If cards are removed from the top list (assuming it's an array), how would you indicate that something has been removed? I mean, we have to keep passing over the list multiple times, and you can skip the "gaps" with your fingers, but what value could we put into an array that indicates "this one has been removed, please skip it?"

  • This is misleading. It gives the impression that a new array is being built while in reality there is a swap between array elements.

  • e gusto professore

  • Possibly the most helpful video on algorithms I've ever seen. Great job once again

  • Thanks !

  • So nicely explained... I like it..

  • Nicely done. The only thing I think that would make this complete is if you showed exactly how the element values in the array are swapped. Cheers mate!

  • @BkBlu45 Yes, and it would be wonderful if a computer could understand those instructions, but they don't and you have to program the computer in excruciating detail exactly how to sort the cards (or at least someone does and you use their library)

  • @BkBlu45 This would defeat the purpose of the video. However, your question is fair enough. There are different ways of "putting the cards in order, biggest to smallest." Why is this important? Because some ways are faster than others. Lets say that instead of doing this method I check each two adjacent cards and if the first is bigger than the second I swap them and check the next two cards, etc.. I will have to do this many many times before all my cards are sorted. Method is important.

  • thanks,. thats gr8,. u made me understand finally

  • Your an awesome teacher!

  • thank you, your videos are really helpful, I also would like you to prepare a video for quick sort if that possible.. thanks..

  • Are you Australian by any chance?

  • Any more posts on the sorting.. ?  Thanks for the 3 posts... never occured for me to explain someone sorting with cards.. thanks..

  • best video on selection sort.

    Thank You.

  • Nice

  • great vid...

    thanx.keep going..

  • This version you show here need to double the memory space, one array as the original, one array as the sorted result. The version I did learn didn't need extra memory.

  • @newcoleco While it does require more momery, this variation has the advantage of making the sort stable. (swapping variation is not stable)

  • Hello Alister :)

  • Great sorting videos with playing cards, I like them all. But this video should be called "Selection sort".

    I think Selection sort have at least one advantage over Insertion sort, and it's doing the minimum "swap" to sort the entire list or array. Because swaping cost more than comparing, Selection sort is better.

    There still other popular sorting algorithms like shell sort, heap sort, and quick sort. Will you explain them too with playing cards?

  • Oops, thanks newcoleco your right, I have updated the title and description - not sure how i missed this one.

  • @newcoleco there is no such thing as the best sorting algorithm. It all depends on the circumstances.

    For instance: it would be quite a waste to apply selection sort to a list of data that already is more or less sorted, because it would take just as much time as if it were ordered randomly.

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more