

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


The CS2110 Final is optional. As soon as possible, we will post grades for A8 and tentative course letter grades. You will answer a 1-question assignment on the CMS: Do you accept the letter grade or will you take the final? This question will become available at the same time that we post the tentative letter grades_._ If you walk into the final room, you must complete the final. For example, you may not decide half way through the final that you don’t want to take it. A few students missed one of the two prelims and are required to take the final unless other arrangements have been made. Taking the final may lower or raise your course grade. Our past experience: taking the final changes the letter grade for very few —fewer than 10 in a course of 200, mostly raises. Conflicts. If there is a chance you may take the exam and you have a conflict, please email Megan Gatch, [email protected], immediately. How we handle con- flicts depends on how many conflicts there are. We de- fine “conflict” as having another final at the same time or having more than two finals within a 24-hour period, thus following university policy. Quiet room / extra time. If Cornell allows you extra time or a quiet room for the exam, please email Megan Gatch, [email protected], so that we know how many there are of you. Room: TBA. Review session : Java. Fri , 13 May. 10AM. Gates G Review session : Data structures, algorithms, concurren- cy. Fri , 13 May.11AM. Gates G Overall length and balance of the exam. Similar to past CS2110 exams, but it will be 150 minutes long. Piazza note @472, Supplemental Study Notes , contains material that will be useful in studying for the final. Everything that could be on P1 or P2 could be on the final. We spell this out in more detail below. Programming. Being able to write correct code in Java is absolutely critical. You should have skill in using arrays, Strings, loops (while, for, and for-each), writing procedures, functions, constructors, etc. You will be asked to write at least one recursive method. JAVA. Know the basics of Java. Use the summary giv- en for both prelims and the JavaSummary (ppt slides) on the course website. You may be asked about any- thing in these references, including access modifiers, abstract classes, and interfaces. In addition, know about inner classes, nested static classes, and enums. You will not be asked questions about reading/writing files. See the P1 and P2 review handouts for more details. Java Collection Hierarchy. Basic understanding of how to use Collection
declaring an interface. Know the meaning of amortizing the cost of an operation. Knowledge of particular ADTs. Know the following ADTs and their basic operations: stack, queue, set, pri- ority queue, heap. Be able to design and write: An implementation of a stack in an array; an implementation of a queue in an array using wraparound, so that removing the first and putting something at the end are constant time opera- tions; an implementation of a heap and priority queue in an array. Linked lists. Describe the data structure used to imple- ment singly linked lists, doubly linked lists, and circular lists, and each of these with a header. Know the ad- vantages of each. Be able to write code on how to insert or delete an element. Hashing. The idea of a hash function and the basic idea of hashing. Solving collisions using linear or quadratic probing; why, when using such probing, one can’t simp- ly remove an element by setting the array element in which it appears to null. Load factor, and the fact that if it is ½, at most 2 probes are expected in searching for a value. Chaining (solving collisions using a linked list of values that hash to the same address). Trees. Definition of a tree and the general terminology associated with trees —node, child, sibling, parent, leaf, etc. Notion of a balanced tree. Data structures to implement trees. Be able to write a tree traversal —both breadth-first and depth-first. Be able to write code to perform operations on trees, such as finding the depth of tree, finding an element, etc. Binary search trees (BSTs): Definition. Write algorithm to search a BST for a value, know its order of execution time. Graphs. Two major data structures for a graph: adja- cency matrix and adjacency list. Advantages/ disad- vantages of each (in terms of the complexity of the primitive graph operations). Topological sorting of a DAG. Bipartite graphs and vertex coloring. Be able to code breadth-first and depth-first search and understand when each is useful. Dijkstra’s shortest path algorithm. While we will not ask you to write it, we may ask you questions about it —e.g. for a node w in each of the three sets of nodes, what does L[w] contain? What is its loop invariant? For a connected graph of n nodes, what is the order of exe- cution of the algorithm? What data structure do you use for one of the sets to achieve it? Which representation of the graph leads to a better execution time – adjacency matrix or adjacency list? Minimal spanning trees. Be able to express Prim’s algorithm and Kruskal’s algorithm at a high level – not an implementation —how do they pick the next edge to add to the spanning tree? Understand key concepts that arise when proving the correctness of programs. Know what we mean by specifications, preconditions, postconditions, the Hoare triple, and invariants (class invariant, loop invariant). Be familiar with the lectures that used these terms and be able to answer questions about them. If the pre- and post-conditions are given by array diagrams (as we did for selection sort, partition algorithm, etc.), be able to draw a diagram that generalizes the pre- and post- condition —as a possible invariant. Concurrency. Be familiar with two issues seen when two or more threads of execution are running concur- rently, perhaps both referring to and changing shared variables: race conditions and deadlock. Java implementation of threads. Know how one cre- ates a thread and starts it running. Be able to use key- word familiar synchronized and the methods wait, noti- fy, and notifyAll within a synchronized block. Under- stand the bounded-buffer problem as discussed in lec- ture. Be prepared to edit existing code using keyword syn- chronized to make it thread safe.