Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

how does the selection sort algorithm works?

Computer Science
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
It works by passing through the the sequence n-1 times, working its way up the sequence. In each pass, it looks for the smallest element in the sequence (say I'm sorting in ascending order), storing it in a register. Once the pass is complete, it swaps the smallest element with the element in the current index and moves on.
http://www.youtube.com/watch?v=t8g-iYGHpEA selection sort is in there
Click on the green icon on top-left of this page http://www.sorting-algorithms.com/selection-sort It'll start visualizing the lines below which describes the how sorting is going on. There are also other visualizations for diff. alogs.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Base on the O(n). Where does the selection sort falls. Is it O(nlogn) or ?
\[O(nLogn)\]
Please some body explain this for me --> O(nLogn).
Ok, i asked this question a few back on CS.SE, it's better you have a look at all answers there than i explain http://cs.stackexchange.com/questions/192/how-to-come-up-with-the-runtime-of-algorithms
Actually, selection sort is \(O\left(n^2\right)\)

Not the answer you are looking for?

Search for more explanations.

Ask your own question