You are on page 1of 9

Presentation

on
Selection Sort
Basics of Selection Sort:

1. It is Simple sorting algorithm.


2. It finds the minimum or maximum element in an
unsorted array and then putting it in its correct
position.
3.It is also comparison-based algorithm in which the
list is divided into two parts:
 i. The sorted part
 ii. The unsorted part
Process of Selection sort:

The smallest element is selected from the unsorted


array and swapped with the leftmost element.
ie, That element becomes a part of the sorted array.
 This process continues moving unsorted array
boundary by one element to the right until the final
result.
Result can be either in ascending or descending
order.
Pictorial Representation of Selection Sort:
Procedures of Selection Sorting:

1. Comparison: The times of comparison in a n value


array is (n(n-1))/2.
2. Value Assignment: The times of value assignment is
between 0 to 3(n-1).
3. Exchanging: The times need is between
0 to (n-1).
Hence, This algorithm is not suitable for large data
sets as its average and worst case complexities are of
Ο(n2), where  n is the number of items.
Disadvantage os Selection Sort:

1. The algorithm of Selection sort will vary in different


kinds of data structures.
2. If the data structure is stack or queue, the algorithm
is different.
3. The algorithm can not run in-place, the execution
need extra memory in computer.
4. The algorithm need extra memory to temporary
store the value which need to be changed in the swap
method.

You might also like