Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Selection Sort

No description
by

Lama a

on 10 May 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Selection Sort



By:
Lama Al-Otayeq
Norah Al-Motlaq

Instructor:
Lubna Maqbool Khawaja

2014 May 11

What is Selection Sort ?


Selection sort is a very simple sorting algorithm which is very useful for sorting a small amount of data.

This type of sorting is called "Selection Sort" because it works by repeatedly element.

ALGORITHM
For i = 0 to n - 2
temp = a [ i ]
loc = i
for j = i + 1 to n - 1
if a [ j ] < a [ loc ]
loc = j
a [ i ] = a [ loc ]
a [ loc ] = temp

Advantages:
It is very easy to understand and learn.

Disadvantages:
It is still one of the slower methods
HOW A SELECTION SORT WORKS ?
1- find the smallest element
in the list.
2- Exchange the element in
the first position and
the smallest element.
3- Repeat step 1 and 2 with the
list having one less element


Original list

Pass 1

Pass 2

Pass 3

Pass 4

Pass 5

Pass 6



output
Any questions?
References
http://www.csit.parkland.edu/~mbrandyberry/CS1Java/Lessons/Lesson28/SelectionSort.htm
http://interactivepython.org/runestone/static/pythonds/SortSearch/sorting.html
http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/selectionSort.htm
http://mathbits.com/MathBits/CompSci/Arrays/Selection.htm
http://www.dusanjov.com/blog/selection-sort-algorithm-source-code/
http://www.csepedia.com/Selection_Sort.html


SELECTION SORT PROGRAM
IN C++
Comparison to other
sorting technique
Selection Sort
Full transcript