Selection Sort Summary

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
257 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 18, 2009

Definition: Selection sort also falls under the basic sorting algorithms but its performance is better than bubble sort because it reduces the number of swaps. Consider an array that needs to be sorted: Steps: 1. Start from the left and record the elements value. 2. Proceed down the array and compare the value of the element to the elements that are still available;if you find a element with a value smaller than the first one; keep a note of it. 3. If, while moving down the array you encounter any other smaller values than the one you have recorded; discard the previous one you have recorded and keep note of the current one you have found. 4. If you reach the end of the arrary then swap the smallest elements position with the first element(far left) and start the procedure from the beginning but increment the count by one because the first element is in its sorted position.

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...
Alert icon
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