KEMBAR78
Presentation on the topic selection sort | PPTX
Presentation on the
topic Selection Sort
Presented By
Saddam Hussain
Ravi Kr Singh
Rashan Pradhan
Raju Shah
Contents
 Definition of Selection sort
 Example
 Algorithm with an Example
 Advantage and disadvantages
 conclusion
SELECTION SORT
In computer science,
selection sort is a sorting
algorithm, specifically and in
place comparison sort. It has
0(n2 time complexity.
Selection sort is noted for its
simplicity and it has
performance advantages.
HOW IT WORKS
The algorithm proceed by finding the
smallest (or largest depending on
sorting order) element in the unsorted
sublist , exchanging (swapping) it with
the left most unsorted element (putting
it in sorted order and have the sublist
boundaries one element to the right.
FOR EXAMPLE
23 78 45 8 32 56 1
23 42 4 16 8 15
Current min=23
Algorithm
 Step 1 − Set MIN to location 0
 Step 2 − Search the minimum element in
the list
 Step 3 − Swap with value at location MIN
 Step 4 − Increment MIN to point to next
element
 Step 5 − Repeat until list is sorted
for i=1 to n-1
min=I
for j=1+1 TO N
if array[j] < array[min]
min = j
if min != i
swap array[min] and array[i]
Advantages
 The main advantage of the selection sort
is that it performs well on a small list.
 Because it is an in-place sorting
algorithm, no additional temporary
storage is required beyond what is needed
to hold the original list.
 Its performance is easily influenced by the
initial ordering of the items before the
sorting process.
Disadvantages
 The primary disadvantage of the selection
sort is its poor efficiency when dealing
with a huge list of items.
 The selection sort requires n-squared
number of steps for sorting n elements.
References
 www.tutorialpoints.com/selection_sort
 www.wikipedia.com/selection_sort
 www.google.com
Thank You

Presentation on the topic selection sort

  • 1.
    Presentation on the topicSelection Sort Presented By Saddam Hussain Ravi Kr Singh Rashan Pradhan Raju Shah
  • 2.
    Contents  Definition ofSelection sort  Example  Algorithm with an Example  Advantage and disadvantages  conclusion
  • 3.
    SELECTION SORT In computerscience, selection sort is a sorting algorithm, specifically and in place comparison sort. It has 0(n2 time complexity. Selection sort is noted for its simplicity and it has performance advantages.
  • 4.
    HOW IT WORKS Thealgorithm proceed by finding the smallest (or largest depending on sorting order) element in the unsorted sublist , exchanging (swapping) it with the left most unsorted element (putting it in sorted order and have the sublist boundaries one element to the right.
  • 5.
    FOR EXAMPLE 23 7845 8 32 56 1
  • 6.
    23 42 416 8 15 Current min=23
  • 7.
    Algorithm  Step 1− Set MIN to location 0  Step 2 − Search the minimum element in the list  Step 3 − Swap with value at location MIN  Step 4 − Increment MIN to point to next element  Step 5 − Repeat until list is sorted
  • 8.
    for i=1 ton-1 min=I for j=1+1 TO N if array[j] < array[min] min = j if min != i swap array[min] and array[i]
  • 10.
    Advantages  The mainadvantage of the selection sort is that it performs well on a small list.  Because it is an in-place sorting algorithm, no additional temporary storage is required beyond what is needed to hold the original list.  Its performance is easily influenced by the initial ordering of the items before the sorting process.
  • 11.
    Disadvantages  The primarydisadvantage of the selection sort is its poor efficiency when dealing with a huge list of items.  The selection sort requires n-squared number of steps for sorting n elements.
  • 12.
  • 13.