## Final Exam

This will be on Thu, Dec 19, in usual classroom 312, from 3:30-7:30 pm.

It is a closed-book exam. But we will allow a 8"x11" sheet (2-sided) of notes which you prepare in advance. We will collect these sheets at the end of the exam.

Here is a set of study questions StudyQuestions.pdf

Here is the StudyQuestions-sol.pdf (posted Dec 17).

COMMENTS ON SOLUTION:

- Q1: my construction of gadget II is wrong (why?). Can you find the correct construction?

[SOLUTION: use 2 copies of gadget I as before. Their distinguished vertices are (A,B) and (A',B').Identify B with B'. Then introduce a new vertex C and form a triangle (A,A',C). Now A and C must have different color] - Q2: The problem should say "AT MOST B" not "AT LEAST B". Reason? We want to force the path to go through as many clauses as possible.
- Q4: Claim C can be improved: v is a bottleneck iff it is a candidate. Thanks to Nguyen for pointing this out.
- Q5: The claim that we can find real bottlenecks in O(m+n) time is a bit subtle. We did not provide the details, but try to see if you can do this. Thanks to Nguyen for pointing this out.
- Q7: our solution actually uses this definition: An edge e=(i,j) is "essential" if C(e)=\delta(i,j). We do not actually ensure that there are no alternative paths from i to j with cost at most C(e). Doing this seems a bit tougher.

## Midterm Exam

- This will be in class, on Oct 10.
- Get a sample copy of a past midterm exam from NYU Classes, under resources.
- This is an open-book exam, but not open-computer or electronic devices (or calculators). Sorry, if you want the lecture notes, you must print a copy.
- In terms of topics, you are technically responsible for everything up to the lecture on Oct 8. That means the first 6 Lectures. But the first 3 Lectures will be emphasized, especially on topics in the lecture and in the homework.
- To ensure adequate coverage, we will have a section of short questions.
- Here are more remarks, based on your questions (click to expand):

- Does "double rotation" just mean "rotate^2(u)"?
- No, it is not the same thing. According to p.17 of Lect.III, it must be either zig-zag or zag-zig. But zig-zig or zag-zag do not count as 'double rotation'. Of course, all four cases comes under 'rotate^2(u)'.
- Bug in Non-Recursive DFS
- Line 9-10 should be changed to:

PREVISIT(v,u); If (v is unseen), then color v seen.

In short, you should ALWAYS do the PREVISIT.

This is clear, if you remember that PREVISIT amounts to processing the edge (u,v). Thanks to Huaisi for pointing this out. - Homework 3, question 10 on height of AVL tree with 100 nodes
- This is a question about min-size AVL trees. :It is a typo NOT to have said this. My intent is clear from the model answer. But you should answer the question without making this assumption! That is, you should always read a question literally. We will grade you accordingly.
- In proofs, can I quote your theorems?
- YES, you can (probably SHOULD). Unless I specifically forbid it.

E.g., I might say, prove from first principles and do not quote the Master Theorem, etc.

Note that there is STILL some work to do, even if you quote theorems.

E.g., when quoting the Master Theorem, you still need to show that a particular case applies. That may require showing regularity, etc.

E.g., in estimating sums using our Rules for Polynomial-type or Exponential-type, you may need to justify why they are polynomial- or exponential-type. - Hand Simulations
- Be sure you can do rotations and all the associated algorithms on actual trees.

For AVL Trees, be familiar with the insert/delete as well as the Merge/Split algorithms (Split is described in solution of hw3)

Since we disallow calculators, you are expected to do hand calculators (review your rules for logarithms and exponentiations).