Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sorting
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Common algorithms==== {{main|Sorting algorithm}} * '''[[Bubble sort|Bubble]]/[[Shell sort]]''': Exchange two adjacent elements if they are out of order. Repeat until array is sorted. * '''[[Insertion sort]]''': Scan successive elements for an out-of-order item, then insert the item in the proper place. * '''[[Selection sort]]''': Find the smallest (or biggest) element in the array, and put it in the proper place. Swap it with the value in the first position. Repeat until array is sorted. * '''[[Quick sort]]''': Partition the array into two segments. In the first segment, all elements are less than or equal to the pivot value. In the second segment, all elements are greater than or equal to the pivot value. Finally, sort the two segments recursively. * '''[[Merge sort]]''': Divide the list of elements in two parts, sort the two parts individually and then merge it.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)