Upload
lydia-anthony
View
222
Download
0
Embed Size (px)
DESCRIPTION
Sorting Algorithms
Citation preview
Can you put these children’s TV shows in date order - earliest to latest?
19871964 19971974
Sorting Algorithms
Algorithm
Precise method for solving a problem
Sorting Algorithm
Order a list
ABC
Sorting Algorithms - alphabetical
Sorting Algorithms - Alphabetical
123
Sorting Algorithms - numerical
Sorting Algorithms - numerical
Know sorting algorithms mainly sort alphabetically or numerically
Sorting Algorithms - Objectives
Sorting Algorithms
Selection Sort
Selection Sort
● Data divided into sorted & unsorted portions
● Smallest values from unsorted portion are selected & put into sorted portion.
Bubble Sort
Bubble Sort
● Compare adjacent elements & swop if out of order
● Largest number ‘bubbles up’ to end of list
Bubble Sort
● Compare adjacent elements & swop if out of order
● Largest number ‘bubbles up’ to end of list
Quick Sort
Quick Sort
Quick Sort
● Pick random element ‘pivot’● Put to one side● Compare other elements to ‘pivot’● Put smaller to left● Larger to right● Repeat with other groups
Quick Sort
● Divide & conquer
● Larger lists
Sorting Algorithms
Compare & contrast the 3 sorting algorithms
Understand3 different types of sorting algorithms
Sorting Algorithms - Objectives
Comparing Algorithms - extension
● ‘Big O’ notation● Best & Worse Case● Computational thinking● Programs● CSUnplugged
Other Sorting Algorithms
● Merge Sort● Insertion Sort ● Cocktail Sort● Gnome Sort
Apply your knowledge & understanding of sorting algorithms to your teaching
Sorting Algorithms: Objectives
KS2:use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs KS3: understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem
National Curriculum
●Know sorting algorithms mainly sort alphabetically or numerically
●Understand 3 different types of sorting algorithms
●Apply your knowledge & understanding of sorting algorithms to your teaching
Sorting Algorithms: Objectives
What have you learnt today that you can use in your classroom tomorrow?
Sorting Algorithms
Sorting Algorithms: Objectives