Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Algorithms #3 - Selection Sort

Loading...

Sign in or sign up now!
43,351
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 10, 2008

This time we take a look at how Selection Sort works, this being the third sorting algorithm in our series.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (codegearguru)

  • @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)

  • 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.

Top Comments

  • Your an awesome teacher!

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

  • 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

  • @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.

  • @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.

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