Download presentation
Presentation is loading. Please wait.
Published byEmily Todd Modified over 9 years ago
1
Teacher Talk 2011
2
1.There has never been a better time to teach Computer Science 2.We can learn from Chemistry, Physics, Biology, …
3
What am I going to show you? First, I will use sorting to demonstrate “This is the best time to teach CS” Second, I will use binary trees (and AVL trees) to show we can do what Chemists do
4
Sorting, what’s that then? Given a collection of data, get it into order …
5
Sorting, what’s that then? Given a collection of data, get it into order … 9 2 6 0 4 3 2 7 5 This is NOT in order
6
Sorting, what’s that then? Given a collection of data, get it into order … 0 2 3 4 5 6 7 9 This is IS in order
7
Sorting, what’s that then? Given a collection of data, get it into order … 0 2 3 4 5 6 7 9 This is IS in order It’s in ascending order
8
Sorting, what’s that then? Sorting is the process of going from this 0 2 3 4 5 6 7 9 9 2 6 0 4 3 2 7 5 to that
9
Sorting, why bother? 9 2 6 0 4 3 2 7 5 Who cares? You can find things quicker!
10
Sorting, why bother? 0 2 3 4 5 6 7 9 9 2 6 0 4 3 2 7 5 Who cares? You can find things quicker! Use “binary search” (or even linear search and stop early)
11
Sorting, why bother?Who cares? Do you remember the telephone directory? Imagine if it was just in any order (random) How long would it take you to find my telephone number?
12
Sorting, why bother?Who cares? Do you remember the telephone directory? Imagine if it was just in any order (random) How long would it take you to find my telephone number? Do you remember the dictionary? Imagine if that was just in any order. How long would it take to find a word, or to determine if the word was not present?
13
Sorting, why bother?Who cares? Do you remember the telephone directory? Imagine if it was just in any order (random) How long would it take you to find my telephone number? Do you remember the dictionary? Imagine if that was just in any order. How long would it take to find a word, or to determine if the word was not present? Do you ever use an online spelling checker? How does that work?
14
Sorting, why bother?Who cares?
15
Sorting, why bother?Who cares? What do you prefer?
16
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting
17
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting What’s an algorithm?
20
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting quadratic
21
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting logarithmic
22
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting linear
23
Some algorithms for sorting bubble sort insertion sort selection sort shell sort gnome sort merge sort quick sort heap sort radix sort bead sort sorting Our example
26
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example
27
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example compare
28
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example swap
29
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example compare
30
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example swap
31
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example compare
32
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example swap
33
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example compare
34
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example swap
35
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example compare
36
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example swap
37
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example compare
38
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example swap
39
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example compare
40
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example swap
41
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example compare
42
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032795 Example swap
43
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example
44
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare
45
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare
46
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example swap
47
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example compare
48
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example swap
49
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example compare
50
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example swap
51
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example compare
52
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example swap
53
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare
54
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare
55
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 9 7 Example swap
56
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example
57
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example Are you tired yet? Bored?
58
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example compare
59
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example swap
60
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare
61
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare
62
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example swap
63
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example compare
64
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example swap
65
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare
66
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare
67
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223456 97 Example swap
68
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example
69
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare
70
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare
71
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare
72
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example swap
73
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare
74
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare
75
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example
76
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare
77
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare
78
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare
79
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare
80
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example
81
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example Phew!
82
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array
83
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example i=8
84
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example compare i=8 j=0
85
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example swap Example i=8 j=0
86
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example compare Example i=8 j=1
87
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example swap Example i=8 j=1
88
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example compare Example i=8 j=2
89
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example swap Example i=8 j=2
90
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example compare Example i=8 j=3
91
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example swap Example i=8 j=3
92
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example compare Example i=8 j=4
93
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example swap Example i=8 j=4
94
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example compare Example i=8 j=5
95
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example swap Example i=8 j=5
96
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example compare Example i=8j=6
97
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example swap Example i=8j=6
98
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example compare Example i=8j=7
99
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032795 Example swap Example i=8j=7
100
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example sorting Example
101
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare sorting Example i=7 j=0
102
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare Example i=7 j=1
103
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example swap Example i=7 j=1
104
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example compare Example i=7 j=2
105
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example swap sorting Example i=7 j=2
106
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example compare sorting Example i=7 j=3
107
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example swap sorting Example i=7 j=3
108
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example compare sorting Example i=7 j=4
109
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example swap sorting Example i=7 j=4
110
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare sorting Example i=7j=5
111
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare sorting Example i=7j=6
112
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 9 7 Example swap sorting Example i=7j=6
113
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example
114
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example compare sorting Example i=6j=0
115
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example swap Example i=6j=0
116
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare Example i=6j=1
117
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare Example i=6j=2
118
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example swap Example i=6j=2
119
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example compare Example i=6j=3
120
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example swap Example i=6j=3
121
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare Example i=6j=4
122
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare Example i=6j=5
123
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223456 97 Example swap Example i=6j=5
124
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example
125
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=0
126
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=1
127
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=2
128
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example swap Example i=5j=2
129
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare Example i=5j=3
130
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare Example i=5j=4
131
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example
132
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=0
133
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=1
134
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=2
135
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=3
136
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example
137
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example
138
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example
139
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example Phew!
140
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this?
141
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last
142
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last 920643257
143
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last 920643257 A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8]
144
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last 920643257 A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] We could plot A[i] on a graph as a point with x/y coordinates i/A[i]
145
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last 920643257 A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] We could plot A[i] on a graph as a point with x/y coordinates i/A[i] Do this as the algorithm progress to see how it progresses.
146
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this? Assume we have a random list of numbers from 0 to n-1, put in an array A Such that A[0] is the 1 st number and A[n-1] is the last 920643257 A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] We could plot A[i] on a graph as a point with x/y coordinates i/A[i] Do this as the algorithm progress to see how it progresses. Ready?
147
Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array
148
sorting Bubble Sort Show me more!
149
sorting Bubble Sort Show me more! different sorting algorithms and relative performance a beauty contest what is the “sound” of sorting? can you show me it by mime? Expressive dance?
150
sorting Bubble Sort NOTE to self: Bubble sort is a quadratic time algorithm. If I have to sort a data set of N objects the run time will be proportional to N 2
151
sorting Bubble Sort NOTE to self: Bubble sort is a quadratic time algorithm. If I have to sort a data set of N objects the run time will be proportional to N 2 To sort 10 numbers will take 100 units of time
152
sorting Bubble Sort NOTE to self: Bubble sort is a quadratic time algorithm. If I have to sort a data set of N objects the run time will be proportional to N 2 To sort 10 numbers will take 100 units of time To sort 100 numbers will take 10,000 units of time
153
sorting Bubble Sort NOTE to self: Bubble sort is a quadratic time algorithm. If I have to sort a data set of N objects the run time will be proportional to N 2 To sort 10 numbers will take 100 units of time To sort 100 numbers will take 10,000 units of time To sort 1000 numbers will take 1,000,000 units of time
154
Links sorting algorithm animation sound of sorting (part 1) sound of sorting (part 2) bubble sort by folk dancing
155
Barak on Sorting
156
I think there has never been a better time to teach Computer Science end of part 1
162
Live dangerously … live like a teacher, like a Physics teacher, or Chemistry, or Biology, or … Balanced binary trees … without powerpoint
163
Binary search trees and AVL trees
164
Live dangerously
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.