cs 2112 / engrd 2112 object-oriented design and data

26
CS 2112 / ENGRD 2112 Object-Oriented Design and Data Structures — Honors Fall 2016 Dexter Kozen Cornell University Lecture 1: Introduction

Upload: others

Post on 27-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

CS2112/ENGRD2112 Object-OrientedDesignandData

Structures—Honors

Fall2016

DexterKozenCornellUniversity

Lecture1:Introduction

Page 2: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

2

Page 3: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Coursestaff•Instructor:DexterKozen•GradTAs:HubertLin,StephenMcDowell,MaheerIqbal

•Undergradstaff:

3

ZanderBolgarJakeChenAgiCsakiJaneDu

JacobGlueckHarryGoldstein

MattHabelSumnerHearthAlexRendaLucasSilverJesseYuan

Page 4: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Whatit’saboutAnintroductiontocomputerscienceandsoftwareengineering•Programminglanguagefeatures

–dataabstraction,subtyping,genericprogramming–concurrencyandthreads–NotacourseaboutJava!

•Object-orienteddesign—organizinglargeprograms–specifications–designpatterns–frameworksandevent-drivenprogramming

•Datastructuresandalgorithms–recursivealgorithmsanddatastructures–algorithmanalysisanddesigningforefficiency–asymptoticcomplexity,induction–arrays,lists,stacks,queues,trees,graphs,hashtables

4

Page 5: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

•Yoursourceforinformation: http://courses.cs.cornell.edu/cs2112–Lecturenotes:youareexpectedtoread

•mostlynotslides!•maynotincludeeverythingcoveredinlecture•mayincludeextramaterialnotcoveredinlecture•oftenupdatedafterthelecture

–Assignments•maybeupdatedafterinitialrelease

–Pointerstoresources5

Website

Page 6: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Communicatingwithstaff•Best:usePiazzatopostquestions

–http://piazza.com/class#fall2016/cs2112–Answeringotherquestions(well)isgoodkarma–Watchoutforviolatingacademicintegrity!

•CourseannouncementspostedtoPiazza(oremailedtoallstudentsifurgent)

•Myofficehours:Gates436,timesTBA•Consultants–hoursonline,locationTBA–“Frontline”foransweringquestions– consultinghoursstarttoday

6

Page 7: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

CMS•AssignmentswillbesubmittedtoCMS•Grades,solutionswillbepostedonCMS https://cms-b.csuglab.cornell.edu

•RegraderequestsshouldbepostedtoCMSsoonafterreceivinggrade(remindusifnecessary…)

7

Page 8: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Meetings•Lectures:TTh10:10-11,GatesG01•Discussionsections(attend1perweek)–T12:20-1:10(GatesG01)–W1:25-2:15(Hollister110)

•Labs(attend1perweek)–Monday7:30-8:20(Phillips219)–Wednesday7:30-8:20(Hollister110)

•4hoursperweek—attendancerequired

8

Page 9: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Roomcaps•Ifthelecture,lab,orrecitationisfull…–don’tpanic,youcanstilltakethecourse–letusknow,includingyourconstraints–wewillworkoutasolution

9

Page 10: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Assignments•7assignments

–mostlyprogrammingbutsomewrittenproblems–totalto40%oftotalscore

•First3assignmentsdonesolo•Finalproject(last4assignments)withapartner•Assignmentlatepenalties:

–1daylate:–10%–2dayslate:–20%–3dayslate:–30%–weekendscountas1day

10

Page 11: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Examsandmore•Oneeveningprelim:Sept29,7:30pm,GatesG01–20%oftotalscore

•Finalexam:sometimeduringDec7–15,locationandtimeTBA–35%oftotalscore

•5%ofscore:–participation(in-class,Piazza,courseevals)–possiblein-classquizzes

11

Page 12: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Labs•Programmingexercises,solveproblems,learnabouttools

•Bringalaptopifyouhaveone(orshareifyoudon’t—youwillworkinpairsanyway)

•Firstlab:WednesdayinHollister110(setupEclipseanddosomeprogramming)—attendifyoucanevenifyouarenormallyintheMondaylab

12

Page 13: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Textbook•DataStructuresandAbstractionswithJava,4thed.,FrankM.CarranoandTimothyHenry,PearsonEducation,2014.–AvailableatCampusStore–Onreserveinlibrary–Recommended,notrequired–Alsothe2110textbook–Notheavilyused—cansharewithafriendortwo

–Earliereditionsareprobablyok13

Page 14: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Academicintegrity•Youmustnevermisrepresentsomeoneelse’sworkasyourownorletothersmisrepresentyourworkastheirs–Copyingcodeoranswersisneverokay–Lettingotherscopyyouisalsoaviolation–Youmustbeabletoexplainyouranswersfully–Discussionswithothersaredefinitelyfineiftheycouldhavehappenedinalightlessroom

•Wewillusehighlyeffectivetoolsfordetectingplagiarism

•Reportanydiscussionsaboutassignmentsandanyuseofexternalcode

•Ourgoal:spendtimeoncoursecontent14

Page 15: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

SocialintegrityEveryoneistobetreatedwithrespect,regardlessofbackground,experience,religion,ethnicity,citizenship,gender,orsexualorientation

Ifyouaremadetofeelunwelcomeordisrespected,pleasecontactDexter

Ifyoubecomeawareofanyoneelsebeingmadetofeelunwelcomeordisrespected,pleaseencouragethemtocontactDexter

15

Page 16: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

CS2112orENGRD2112?

Doesn’tmatter

16

Page 17: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

CS/ENGRD2110orCS/ENGRD2112?

•2112isan‘honors’versionof2110.–aimedatCSmajors:smaller–harderandmoreinterestingassignmentsincludingafinalprojectspanning4assignments

–morematerial•e.g.,morealgorithmsandtheiranalysis(theory)•e.g.,moreaboutdesignanddesignpatterns(practice)

–morecredits(4vs3)17

Page 18: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

2110vs.2112•Warning:youwillbechallengedhere

18

CS 2110

CS 2112

Page 19: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

1919

Sam Loyd’s 8 Puzzle

Goal: Given an initial configuration of tiles, find a sequence of moves that will lead to the sorted configuration.

A particular configuration is called a state of the puzzle.

Page 20: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

2020

State Transition Diagram of 8-Puzzle

State Transition Diagram: picture of adjacent states. A state Y is adjacent to state X if Y can be reached from X in one move.

Page 21: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

2121

State Transition Diagram for a 2x2 Puzzle

Page 22: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Graphs•Statetransitiondiagraminpreviousslideisananexampleofagraph:amathematicalabstraction–nodes(orvertices):thepuzzlestates–edges(orarcs):thetransitions,possiblylabeled

•Graphsareallaroundus:airlineroutes,roadmaps,orgcharts,pipelines,…

22

n1

n2

e1

Page 23: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Graphalgorithms•Largetoolboxofefficientalgorithmsforgraphshelpussolveproblems:–searchingforbestnodes/shortestpaths–findingmaximumflowthroughgraph–minimumspanningtrees–...

•Andknownhardnessresults(e.g.,findingHamiltoniancycles)tellyouwhatyoucan’tsolve.

23

v1

v2

e1

Page 24: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Softwaredesignchoices•Whatoperationsshouldpuzzleobjectshave?•Howdowerepresentstates?Theinitialstate?Transitions?

•Howdowepresentinformationtotheuserandsupportinteraction?

•Howdowebreakthecodingupintopartsthatcanbecodedindependently?

•Howtostructurecodesoitcanbemaintained,upgraded?

24

Page 25: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

WhyyouneedCS2112•Datastructuresandalgorithmstosolveproblemsefficientlyandeffectively

•Designtechniquestoproducecodethatworksquicklyandkeepsworking

•Computerscience:–algorithms,datastructures,programminglanguages,designprinciples,knowledgeofwhatispossibleandfeasible

•Goodprogrammershavemorefun!–10xmoreproductive–betterabletoadapt,grow,seeopportunities,changetheworld

25

Page 26: CS 2112 / ENGRD 2112 Object-Oriented Design and Data

Nextsteps•GetyourPiazzaaccountsetupASAP•Keepaneyeonthe2112website•Downloadthefirstprogrammingassignment,releasedtoday,dueinaweek

•MakesureyouhaveEclipsedownloadedandworking—seeconsultantsforhelp

•CometolabonWednesdayforhelpgettingstarted

•Havefun!26