CS 150 Introduction to C++ Programming - Spring 1998 |
|---|
[ Home | Lecture Notes| WebTutor | WebTutor Site Map]
Sorting is one of the
most common operations on computers.There are many methods of
sorting. Sorting algorithms use arrays to store the values before
and after they are sorted. Here we discuss a method called Selection
Sort.
The basic strategy behind Selection Sort is the
following:
Translating this strategy into an algorithm written in pseudocode:
for each location in the array find the next smallest element swap that element into its proper location