NAME: _
NETID: _
CS2110 Fall 2013, Prelim 1
Thursday Oct 10, 2013 (7:30-9:00p)
The exam is closed book and closed notes. Do not begin until instructed. You have 90 minutes. Good luck!
Write your name and Cornell netid on top! There are 6 questions and an

NAME: _
NETID: _
CS2110 Fall 2009 Prelim 2
November 17, 2009
Write your name and Cornell netid . There are 6 questions on 8 numbered pages. Check now that you
have all the pages. Write your answers in the boxes provided. Use the back of the pages for work

4/21/15
Assignment in math or physics
2
Separate, independent problems. You spend time on
each one, doing the best you can. Your grade is the sum
of grades on individual problems.
DEVELOPING PROGRAMS
FOR AN ASSIGNMENT
OR FOR ANY PURPOSE
Lecture 23
CS2110

5/12/15
About prelim 2
Mean: 76.3. Median: 78
2
The few programming problems Please do not email asking for
(recursion) were not done so well, your course grade based on
will discuss in a minute.
what you have done so far.
Pick up prelim in handback room

1
Assignment A8: Shipping Game
2
In a nut shell:
Bunch of cities with roads between them (a graph)
Parcels sitting at cities, have to be trucked to other cities
Trucks, all at a city called Truck Depot, have to be used to
move each parcel from its star

3/18/15
Readings and Homework
2
Read Chapter 26 A Heap Implementation to learn about heaps
Exercise: Salespeople often make matrices that show all the great
features of their product that the competitors product lacks. Try this
for a heap versus a BST. Fi

3/18/15
Prelim and grading A4
2
Purpose of prelim: provide feedback on what you learned.
Did you pick up your prelim yet?
We do make mistakes
Did you pick up your prelim yet?
I have ~25 regraded prelims up front. Pick up before/after
class if you want. (R

3/4/15
1
ADT: Abstract Data Type
2
Just like a type: Bunch of values together with operations on them.
Used often in discussing data structures
Important: The definition says ntthing about the implementation,
just about the behaviour of the operations wha

CS2110, Fall 2013.
Preparing for Prelim 1
Prelim: Thursday, 10 October, 116 Kennedy Hall
5:30-7:00PM if your student ID number is odd
7:309:00PM if your student ID number is even
If your ID # is odd and you have a conflict with the earlier time,
contact A

NAME: _
NETID: _
CS2110 Spring 2013 Prelim 2
April 16, 2013
Write your name and Cornell netid. There are 5 questions plus one extra credit question on 7 numbered
pages. Check now that you have all the pages. Write your answers in the boxes provided. Use t

NAME: _
NETID: _
CS2110 Fall 2013 Prelim 2
November 21, 2013
Write your name and Cornell netid. There are 5 questions plus one extra-credit question on 10
numbered pages. Check now that you have all the pages. Write your answers in the boxes provided. Use

CS2110 Fall 2013 Final
Write your name and Cornell netid. There are 5 questions on 14 numbered pages. Check now
that you have all the pages. Write your answers in the boxes provided. Use the back of the pages
for workspace. Ambiguous answers will be consi

NAME: _SOLUTION SET _
NETID: _SOLUTION SET_
CS2110 Fall 2010 Final Exam SOLUTION SET
December 16, 2010, 2pm-3:30pm
Write your name and Cornell netid. There are 5 questions on 10 numbered pages and one extra credit
problem on page 11 for a possible 6 point

CS211 S05 Final Exam Grading Guide
1. As given in answer key. O(n/2) for (d) - no credit.
2. As given in answer key. List for (d) - no credit.
3. As given in answer key.
4. Base case 2
Inductive case 4
-1 don't say n is odd
-1 don't show where IH is us

CS 2110. Final Exam: 7:008:30PM, Wednesday, 11 December, Baker Laboratory
The Length of the Final is 90 minutes. Cornell gives
us the room for longer but the exam length

NAME: _
NETID: _
CS2110 Fall 2013 Prelim 2
November 21, 2013
Write your name and Cornell netid. There are 5 questions plus one extra-credit question on 10
numbered pages. Check now that you have all the pages. Write your answers in the boxes provided. Use

NAME: _SOLUTIONS_
NETID: _
CS2110 Fall 2010 Prelim 2 Solution Set
November 16, 2010
Write your name and Cornell netid . There are 6 questions on 11 numbered pages and 1 extra credit
question on page 12. Check now that you have all the pages. Write your an

NAME: _
NETID: _
CS2110 Spring 2013 Prelim 2
April 16, 2013
Write your name and Cornell netid. There are 5 questions plus one extra credit question on 7 numbered
pages. Check now that you have all the pages. Write your answers in the boxes provided. Use t

5/12/15
Fibonacci function (1202)
Fibonacci
(Leonardo Pisano)
1170-1240?
Statue in Pisa Italy
2
fib(0) = 0
fib(1) = 1
fib(n) = fib(n-1) + fib(n-2) for n 2
But sequence
described much
earlier in India
/* Return fib(n). Precondition: n 2.*/
public static in

Graphical User Interfaces
CS 2110 Spring 2015
The Xerox Star GUI, 1981
Ivan Sutherland: Sketchpad, https:/youtu.be/57wj8diYpgY
Xerox and Apple
Steve was working on a new secret project
and [we] were asked to go over to Xerox
PARC and take a look at a new

SEARCHING, SORTING, AND
ASYMPTOTIC COMPLEXITY
CS2110 Spring 2015
Lecture 10
Merge two adjacent sorted segments
2
/* Sort b[h.k]. Precondition: b[h.t] and b[t+1.k] are sorted. */
public static merge(int[] b, int h, int t, int k) cfw_
Copy b[h.t] into anoth

4/18/15
Recitation 10
Big O
See the Study Habits Note @282 on the course Piazza. There
is a 2-page pdf file that says how to learn what you need to
know for O-notation.
Prelim Review
Big O definition
Review: Big O
f(n) is O(g(n)
Is used to classify algori

3/18/15
Sets
Sets
Recitation 7
Set<E>
add(E e);
remove(Object o);
contains(Object o);
size()
Set: collection of distinct objects
Hashing
Sets
How to implement a set?
Array List of values?
VA
NY
CA
0
1
2
Hashing 101
3
Method
Runtime
Have to search through

3/8/15
Enums
How do we represent . . .
Recitation 6
Suits - Clubs, Spades, Diamonds, Hearts
Directions - North, South, East, West
Days of week - Monday, Tuesday . . .
Planets - Mercury, Venus, Earth . . .
Other small sets of values that do not change
Enum

Assignment A4
Collision Detection
CS2110 Spring 1015
1
In A4, you will learn how to handle 2-dimensional graphical objects (also called shapes) and design efficient
algorithms for two tasks.
1.
Checking whether two 2D shapes overlap (collision detection)

3/2/15
Loop Invariants
Four loopy questions
Recitation 5
1. Does it start right?
Does initialization make
invariant P true?
/Precondition
Initialization;
/ invariant: P
while ( B ) cfw_ S
Loop Invariants and Prelim Review
3. Does repetend S make
progress

4/21/15
Big O
Review: Big O definition
Recitation 11
c * g(n)
f(n) is O(g(n)
iff
There exists c > 0 and N > 0
such that:
f(n) c * g(n) for n N
f(n)
Analysis of Algorithms and inductive proofs
n
N
1
2
Big O
Example: n+6 is O(n)
<=
=
=
n + 6 -this is f(n)
<

CS2110 Spring 2015 Assignment A1. PhD Genealogy. Due on CMS by Friday, 6 February
CS2110 Spring 2015 Assignment A1
PhD Genealogy
Introduction
Website http:/genealogy.math.ndsu.nodak.edu contains the PhD genealogy of about 185,578 mathematicians
and compu

Education:
Singapore tops Worlds most comprehensive education rankings
Shows why education is important for country
Singapore is an example of a country that has placed education first and has
been able to "advance from a very poor country to one of the