Sort
A Sorting Algorithm creates order
Last updated
Was this helpful?
A Sorting Algorithm creates order
Last updated
Was this helpful?
A Sorting Algorithm takes a disordered group and orders the group.
Insertion Sort is an algorithm which goes through a list item by item, putting each new item in the correct order.
Insertion Sort:
Create a new list
Pull first item off of unsorted list
Put item in the correct order of new list
Repeat 2 & 3
Example:
Divide & Conquer Sort is an algorithm which splits the list into smaller groups, then sorts the smaller groups, then puts the sorted small groups back together.
Divide & Conquer Sort:
Split Lists in Half
^ Repeat Step 1 ^
Merge & Sort
^ Repeat Step 3 ^
Example:
[$5, $1, $10, $1, $5]
[$5][$1, $10, $1, $5]
[$1, $5][$10, $1, $5]
[$1, $5, $10][$1, $5]
[$1, $1, $5, $10][$5]
[$1, $1, $5, $5, $10]
This type of sorting algorithm is commonly used in playing card games, & organizing cash in wallets
This type of sorting algorithm is commonly used when sorting big lists like the Library of Congress 15,000 book returns per day.