Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reflections of ADS2 2011. “There has never been a better time to teach Computer Science” Patrick Prosser 2011.

Similar presentations


Presentation on theme: "Reflections of ADS2 2011. “There has never been a better time to teach Computer Science” Patrick Prosser 2011."— Presentation transcript:

1 Reflections of ADS2 2011

2 “There has never been a better time to teach Computer Science” Patrick Prosser 2011

3

4 Course home page

5 course content

6 Course content

7

8

9 Aims & Objectives

10 Aims and objectives -Learn about algorithms and data structures in java (surprised?) -Implement algorithms and data structures -Apply algorithms and data structures

11 Ulterior motives -To be scientific -To be an engineer -To be a mechanic -To appreciate beauty -neat, tidy, small, simple, efficient, fast, … -To think critically -Costs and benefits -To do experiments (wherever possible) -Use big data sets (where possible) -“Teach yourself programming in 10 years” -To have fun

12 We are always learning

13

14 exercises

15 5 exercises, 2 are assessed, plus a zero exercise and a challenge

16 exercises… for instance In 2 parts, implement a circular queue then use this to implement a sorting algorithm. Readme files, slides, hints and tips, code stubs to get started. There is a Test program (always is), a marking program (compiled), and data sets Marking program is just a part of final mark

17 exercises… for instance 1 st part of the exercise, code stub

18 exercises… for instance 1 st part of the exercise, code stub

19 Experiments in the Lecture

20 Experiments on the bench (in lecture) -The effect of the wrong data structure -Using the IMDB data sets at Robert Sedgewick’s

21 Experiments on the bench (in lecture) -The effect of the wrong data structure -Using the IMDB data sets at Robert Sedgewick’s

22 Experiments on the bench (in lecture) -The effect of the wrong data structure -Using the IMDB data sets at Robert Sedgewick’s Not a small effort … for only a part of a lecture!

23 Experiments on the bench (in lecture) On Recursion A small effort … for a part of a lecture Perm, power set, H-tree, binary tree, …

24 Experiments on the bench (in lecture) The growth of functions Part of a lecture: editing and running code, using gnuPlot in the class, going off-topic (i.e. general effect of exponential growth “what does 3% economic growth mean?”)

25 Experiments on the bench (in lecture) Binary search A demo that shows how search proceeds Using unixWords (about 400,000 words) A small effort … for a very small part of a lecture!

26 Experiments on the bench (in lecture) Is Big-Oh all there is to it? A considerable effort … for only part of a lecture

27 Experiments on the bench (in lecture) Binary Search Trees v AVL Trees Hashing (different functions) Etc …

28

29 The students have lapTops

30 lapTops in the lectures

31 Now that we have won the lottery, what shall we do about the begging letters? lapTops in the lectures

32 We shall keep sending them lapTops in the lectures

33 What should we do with student lapTops in the lecture theatre?

34

35 The lecture theatre

36 Boyd Orr Lecture Theatre 2

37 -3 screens with 3 data projectors -3 vizualisers -Internet connected pc -Desk top lapTop connection -Lectern/desk that goes up and down -Sound system -On the ground floor, near to toilets, hopping distance from SAWB

38 Boyd Orr Lecture Theatre 2 I love BO2

39 Boyd Orr Lecture Theatre 2 I love the smell of Napalm in the morning ….

40 Boyd Orr Lecture Theatre 2 I love the visualizers … -To use instead of a black/white board -To put things underneath (such as bits of paper) -… or lego -….or stuff I use all of BO2

41 We videoed all the lectures … and what happened?

42 We videoed all the lectures Attendance fell (but hey, Stanford ended up with 20 physical students) 40% < 40%

43 attendance Swipe that!

44 What about the students?

45 -Mostly good -Surprising number are excellent -Thanks to 1 st year and 1 st semester

46

47 The End and yes it was all my own work

48 … just me, and these people Alice Miller David Manlove David Watt Tom Kelly Geoffrey Ciaran Jeremy Singer Paul Cockshott David Andrew Andy Brooks Rob Irving Gethin Norman Gail Reat Karen Renaud Peter Nightingale Andrea & Zoe Stewart McNeil …

49 “This is the best time to teach CS”

50 An example, using sorting

51 Sorting, what’s that then? Given a collection of data, get it into order …

52 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

53 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

54 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

55 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

56 Sorting, why bother? 9 2 6 0 4 3 2 7 5 Who cares? You can find things quicker!

57 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)

58 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

59 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

60 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

61 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

62 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

63 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example

64 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example compare

65 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example swap

66 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example compare

67 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example swap

68 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example compare

69 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example swap

70 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example compare

71 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example swap

72 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example compare

73 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example swap

74 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example compare

75 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example swap

76 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example compare

77 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example swap

78 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example compare

79 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032795 Example swap

80 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example

81 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare

82 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare

83 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example swap

84 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example compare

85 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example swap

86 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example compare

87 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example swap

88 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example compare

89 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example swap

90 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare

91 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare

92 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 9 7 Example swap

93 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example

94 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example Are you tired yet? Bored?

95 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example compare

96 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example swap

97 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare

98 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare

99 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example swap

100 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example compare

101 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example swap

102 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare

103 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare

104 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223456 97 Example swap

105 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example

106 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare

107 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare

108 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare

109 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example swap

110 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare

111 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare

112 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example

113 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare

114 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare

115 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare

116 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare

117 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example

118 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example Phew!

119 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array

120 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example i=8

121 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 920643257 Example compare i=8 j=0

122 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example swap Example i=8 j=0

123 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 290643257 Example compare Example i=8 j=1

124 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example swap Example i=8 j=1

125 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 260943257 Example compare Example i=8 j=2

126 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example swap Example i=8 j=2

127 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 269043257 Example compare Example i=8 j=3

128 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example swap Example i=8 j=3

129 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264093257 Example compare Example i=8 j=4

130 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example swap Example i=8 j=4

131 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264039257 Example compare Example i=8 j=5

132 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example swap Example i=8 j=5

133 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032957 Example compare Example i=8j=6

134 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example swap Example i=8j=6

135 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032759 Example compare Example i=8j=7

136 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 264032795 Example swap Example i=8j=7

137 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example sorting Example

138 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare sorting Example i=7 j=0

139 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2640327 9 5 Example compare Example i=7 j=1

140 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example swap Example i=7 j=1

141 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2046327 9 5 Example compare Example i=7 j=2

142 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example swap sorting Example i=7 j=2

143 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2064327 9 5 Example compare sorting Example i=7 j=3

144 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example swap sorting Example i=7 j=3

145 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034627 9 5 Example compare sorting Example i=7 j=4

146 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example swap sorting Example i=7 j=4

147 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare sorting Example i=7j=5

148 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034267 9 5 Example compare sorting Example i=7j=6

149 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 9 7 Example swap sorting Example i=7j=6

150 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example

151 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 2034265 97 Example compare sorting Example i=6j=0

152 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example swap Example i=6j=0

153 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare Example i=6j=1

154 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0234265 97 Example compare Example i=6j=2

155 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example swap Example i=6j=2

156 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0243265 97 Example compare Example i=6j=3

157 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example swap Example i=6j=3

158 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare Example i=6j=4

159 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223465 97 Example compare Example i=6j=5

160 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 0223456 97 Example swap Example i=6j=5

161 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example

162 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=0

163 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=1

164 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 022345 697 Example compare Example i=5j=2

165 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example swap Example i=5j=2

166 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare Example i=5j=3

167 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245 697 Example compare Example i=5j=4

168 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example

169 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=0

170 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=1

171 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=2

172 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example compare Example i=4j=3

173 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example

174 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 02324 5697 Example

175 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example

176 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort 023245697 Example Phew!

177 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array Can we visualize this?

178 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

179 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

180 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]

181 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]

182 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.

183 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?

184 Quadratic algorithms bubble sort insertion sort selection sort sorting Bubble Sort On an Array

185 sorting Bubble Sort Show me more!

186 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?

187 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

188 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

189 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

190 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

191 Links sorting algorithm animation sound of sorting (part 1) sound of sorting (part 2) bubble sort by folk dancing

192 Barak on Sorting

193 I think there has never been a better time to teach Computer Science end of part 1

194

195

196

197

198

199 Live dangerously … live like a teacher, like a Physics teacher, or Chemistry, or Biology, or …

200 Live dangerously


Download ppt "Reflections of ADS2 2011. “There has never been a better time to teach Computer Science” Patrick Prosser 2011."

Similar presentations


Ads by Google