Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739

Similar presentations


Presentation on theme: "CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739"— Presentation transcript:

1 CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu

2 cell phones off (please) 2

3 Announcements Exam 1 & 2 handback HW4 due April 2 Third is exam is April 21 (last full week of classes) We will be taking attendance –Does not count directly for grade –Just curious who is and is not attending 3

4 Today’s Agenda Algorithm wrap-up Computer graphics introduction 4

5 Describing algorithms Flow-of-control structures –Sequencing –Selection –Repetition Primitive operations –E.g. pairwise comparision 5

6 Developing algorithms Top-down –Start with abstract/general case –Iteratively make more specific Bottom-up –Start with concrete case –Iteratively make more general 6

7 Sorting Put items in order –“smallest” to “largest” –“largest” to “smallest” Ordering can be done in many ways –Name –SSN –GPA, then age, then telephone number 7

8 Selection sort Choose smallest Place at front Repeat with rest until done To sort n numbers, needs O(n 2 ) time 8

9 Merge sort Split into (roughly) equal halves Recursively sort the halves Merge results to produce answer To sort n numbers, needs O(n log 2 n) time 9

10 10

11 Computer Graphics Tron (1982) Shrek (2001, 2004, 2007) LOTR (2001,2002,2003) Harry Potter (2001-2009, current) Pirates of the Carribean (2003, 2006, 2007) Avatar (2009) 11


Download ppt "CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739"

Similar presentations


Ads by Google