Course Review for Object-Oriented Programming and Data Structures | CS 2110, Exams of Computer Science

Material Type: Exam; Class: Object-Oriented Programming and Data Structures; Subject: Computer Science; University: Cornell University; Term: Fall 2008;

Typology: Exams

Pre 2010

Uploaded on 08/31/2009

koofers-user-h8i
koofers-user-h8i 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Course Review
&
A Few
Unanswered
Questions
Lecture 25
CS2110 – Fall 2008
2
Announcements
!Final Exam
"Thursday, Dec 18
"2 - 4:30pm
"Uris Auditorium
!Review Sessions
"Wednesday, Dec 17
"7:30 - 9pm and 9 - 10:30pm
"Upson B17
"Both sessions the same
"Maybe an extra one Tuesday
of next week - watch web site
for an announcement
!For exam conflicts:
"Notify Kelly Patwell today
"You must provide
#Your entire exam schedule
#Include the course numbers
!Definition of exam conflict:
"Two exams at the same time or
"Three or more exams within 24
hours
!A5 due Monday, Dec 8, 11:59pm
"Sorry, no more extensions
3
Announcements
!Jealous of the glamorous life
of a CS consultant?
"We're recruiting next-semester
consultants for CS1110 and
CS2110
"Interested students should fill
out an application, available in
303 Upson
!Check the course website for
additional announcements as
the final exam approaches
"Consulting ends this week
"Office hours continue until
Final Exam
#There may be changes (TAs
have exams, too)
#Any changes will be announced
on the course website
4
Course Evaluations
!Worth one assignment point
"Will count as 1% of your course grade
"This is a regular point, not a bonus point
"Anonymity
#We get a list of who completed the course evaluations and a list of
responses, but no link between names & responses
!Open now
!Closes Wednesday, December 10, midnight
!http://www.engineering.cornell.edu/CourseEval
"This link also appears on the CS2110 announcements page
5
Course Overview
!Programming concepts
#We use Java, but the goal is to
understand the ideas rather than
to become a Java expert
"Recursion
"Object-Oriented Programming
"Interfaces
"Graphical User Interfaces (GUIs)
!Data structure concepts
#The goal here is to develop skill
with a set of tools that are
widely useful
"Induction
"Asymptotic analysis (big-O)
"Arrays, Trees, and Lists
"Searching & Sorting
"Stacks & Queues
"Priority Queues
"Sets & Dictionaries
"Graphs
6
Programming Concepts
!Recursion
"Stack frames
"Exceptions
!Object-oriented programming
"Classes and objects
"Primitive vs. reference types
"Dynamic vs. static types
"Subtypes and Inheritance
#Overriding
#Shadowing
#Overloading
#Upcasting & downcasting
"Inner & anonymous classes
!Interfaces
"Type hierarchy vs. class
hierarchy
"The Comparable interface
"Iterators & Iterable
!GUIs
"Components, Containers, &
Layout Managers
"Events & listeners
pf3
pf4

Partial preview of the text

Download Course Review for Object-Oriented Programming and Data Structures | CS 2110 and more Exams Computer Science in PDF only on Docsity!

Course Review

A Few

Unanswered

Questions

Lecture 25

CS2110 – Fall 2008

2

Announcements

! Final Exam

" Thursday, Dec 18 " 2 - 4:30pm " Uris Auditorium

! Review Sessions

" Wednesday, Dec 17 " 7:30 - 9pm and 9 - 10:30pm " Upson B " Both sessions the same " Maybe an extra one Tuesday of next week - watch web site for an announcement

! For exam conflicts:

" Notify Kelly Patwell today " You must provide

Your entire exam schedule

Include the course numbers

! Definition of exam conflict:

" Two exams at the same time or " Three or more exams within 24 hours

! A5 due Monday, Dec 8, 11:59pm

" Sorry, no more extensions 3

Announcements

! Jealous of the glamorous life

of a CS consultant?

" We're recruiting next-semester consultants for CS1110 and CS " Interested students should fill out an application, available in 303 Upson

! Check the course website for

additional announcements as

the final exam approaches

" Consulting ends this week " Office hours continue until Final Exam

There may be changes (TAs

have exams, too)

Any changes will be announced

on the course website 4

Course Evaluations

! Worth one assignment point

" Will count as 1% of your course grade " This is a regular point, not a bonus point " Anonymity

We get a list of who completed the course evaluations and a list of

responses, but no link between names & responses

! Open now

! Closes Wednesday, December 10, midnight

! http://www.engineering.cornell.edu/CourseEval

" This link also appears on the CS2110 announcements page

Course Overview

! Programming concepts

We use Java, but the goal is to

understand the ideas rather than to become a Java expert " Recursion " Object-Oriented Programming " Interfaces " Graphical User Interfaces (GUIs)

! Data structure concepts

The goal here is to develop skill

with a set of tools that are widely useful " Induction " Asymptotic analysis (big-O) " Arrays, Trees, and Lists " Searching & Sorting " Stacks & Queues " Priority Queues " Sets & Dictionaries " Graphs

Programming Concepts

! Recursion

" Stack frames " Exceptions

! Object-oriented programming

" Classes and objects " Primitive vs. reference types " Dynamic vs. static types " Subtypes and Inheritance

Overriding

Shadowing

Overloading

Upcasting & downcasting

" Inner & anonymous classes

! Interfaces

" Type hierarchy vs. class hierarchy " The Comparable interface " Iterators & Iterable

! GUIs

" Components, Containers, & Layout Managers " Events & listeners

7

Data Structure Concepts

! Induction ! Grammars & parsing ! Asymptotic analysis (big-O) " Solving recurrences " Lower bounds on sorting ! Basic building blocks " Arrays " Lists

Singly- and doubly-linked

" Trees

Binary Search Trees (BSTs)

! Searching " Linear- vs. binary-search ! Sorting " Insertion-, Selection-, Merge-, Quick-, and Heapsort ! Useful ADTs (& implementations) " Stacks & Queues

Arrays & lists

" Priority Queues

Heaps

Array of queues

" Sets & Dictionaries

Bit vectors (for Sets)

Arrays & lists

Hashing & Hashtables

BSTs (& balanced BSTs)

" Graphs... 8

Overview of Graphs

! Mathematical definition of a graph (directed, undirected)

! Representations

" Adjacency matrix " Adjacency list

! Topological sort

! Coloring & planarity

! Searching (BFS & DFS)

! Dijkstra’s shortest path algorithm

! Minimum Spanning Trees (MSTs)

" Prim’s algorithm (growing a single tree) " Kruskal’s algorithm (build a forest by adding edges in order)

Some Unsolved

Problems

10 Complexity of Bounded-Degree Euclidean MST

! The Euclidean MST (Minimum

Spanning Tree) problem:

" Given n points in the plane, determine the MST " Can be solved in O(n log n) time by first building the Delaunay Triangulation

! Bounded-degree version:

" Given n points in the plane, determine a MST where each vertex has degree! d

Known to be NP-hard for d=

[Papadimitriou & Vazirani 84]

O(n log n) algorithm for d=5 or

greater ! Can show Euclidean MST has degree! 5

Unknown for d=

Complexity of Euclidean MST in Rd

! Given n points in dimension d,

determine the MST

" Is there an algorithm with runtime close to the "(n log n) lower bound?

! Can solve in time

O(n log n) for d=

! For large d, it appears that

runtime approaches O(n^2 )

! Best algorithms for general

graphs run in time linear in m

= number of edges

" But for Euclidean distances on points, the number of edges is n(n-1)/

O(n^2 ) Time for X+Y Sorting?

How long does it take to a sort an n-by-n table of numbers? ! O(n^2 log n) because there are n^2 numbers in the table ! What if it’s an addition table? " Shouldn’t it be easier to sort than an arbitrary set of n^2 numbers? ! There is a technique that uses just O(n^2 ) comparisons [Fredman 76] " (^) But it uses O(n^2 log n) time to decide which comparisons to use [Lambert 92] ! This problem is closely related to the problem of sorting the vertices of a line arrangement n-by-n

  • 1 3 5 8 2 3 5 7 10 10 11 13 15 18 12 13 15 17 20 14 15 17 19 22

Good luck on the final! Thanks for an enjoyable semester! Have a great winter break!