0% found this document useful (0 votes)
11 views

Functions: Unsorted List: 1 Pass: 2 Pass

The selection sort algorithm sorts a list by repeatedly finding the smallest element and placing it in the first unsorted position. It has an O(n^2) time complexity and uses less temporary storage space than other algorithms but is inefficient for large lists.

Uploaded by

taeyeonnie kwon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Functions: Unsorted List: 1 Pass: 2 Pass

The selection sort algorithm sorts a list by repeatedly finding the smallest element and placing it in the first unsorted position. It has an O(n^2) time complexity and uses less temporary storage space than other algorithms but is inefficient for large lists.

Uploaded by

taeyeonnie kwon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Selection Sort Algorithm

 It is a simple sorting algorithm.


 It sorts a list of values by repeatedly putting the smallest element
and place into its final position until all arrays are sorted.
 It has less temporary storage space used; however, it is inefficient
for large lists as it has an O(n2) time complexity.

Functions

 The least element in the unsorted list selects to put on its position
until all elements are on its ordered position.

EXAMPLE:

UNSORTED LIST:
64 32 10 25 44
1ST PASS:
10 32 64 25 44
2ND PASS:
10 25 64 32 44

3RD PASS:
10 25 32 64 44
4TH PASS:
10 25 32 44 64
SORTED LIST:
10 25 32 44 64

You might also like