Final Exam Review Page
Exam Information
The exam will be on Wednesday, December 16 in lecture. It will be a conceptual exam (i.e. you will not be writing programs on a computer), although you may be asked to write pseudocode to demonstrate how an algorithm works. You cannot refer to any books, notes, programs, or other resources.
It will consist of:
- multiple choice
- True/False
- short answer, including
- algorithm analysis
- brief explanations
- pseudocode of algorithms/operations
Material to Review
The exam can cover anything discussed this semester. While there will be a focus on material not covered on the midterm, anything throughout the semester may show up. Review material has been available throughout the semester:
There will be a review session in class on Monday, December 14.
Questions about Exam
- Format of the Exam
- Will there be any opportunities for extra credit on the final exam?
- No. That rewards students who can complete the exam quickly (usually those who already understand the concepts and don't need the extra credit) and tempts students who are struggling to complete the exam quickly (often losing points for incomplete/incorrect answers) so they can get to the extra credit.
- How many questions will be on the exam?
- About the same as the midterm, so about a page of multiple choice, True/False, and matching; and about 7 short answer questions.
- Content on the exam
- Will the final be more focused on material covered in the second half of the semester or equally between the first half and the second half?
- Mostly second-half material
- But, concepts build on each other, so you'll still need to be comfortable with midterm material.
- Don't be surprised if you see questions like "It is possible to implement a queue using a stack. How would you do that? What would the runtime of the
enqueue
operation be? What would the runtime of the dequeue
be?
- Although you do have all of the specifics within your notes, I think every student appreciates it when a teacher posts a study guide that has main bullet points with larger concepts (trees, queues, lists, algorithms) and with some sub bullets that specify topics within the concept and what questions we will need to answer about that topic. Also, telling us what type of questions will be asked is helpful. For example, if we have to find amortized runtimes. Or what type of conceptual questions will be asked and how detailed you want our answers to be. Some open ended questions prompt an answer with a couple sentences, while others require a paragraph. Basically, it'd be helpful to know how much of each type there will be.
- Look here for a bullet-point list of larger concepts and sub-bullets for concepts within that for topics within the larger concepts. Click the "Notes" links and look for green boxes to some questions to answer about each topic.
- See also here
- Will we need to know any specificdefinitions for this exam?
- Studying for the exam
- How would you recommend studying for the exam?
- Answer all of the review questions. Know the runtimes of the algorithms/data structures you're asked to implement in the review questions.
- Know the advantages and disadvantages to all of the data structures.
- Is there anything in particular that would definitely show up on the exam?
- Algorithm analysis
- Advantages and disadvantages to data structures, including implementation and runtimes
- Can we get a practice exam?
- You already know what the exam will look like (see Midterm practice and the midterm). You already have plenty of questions to review (see Material to Review). What additional advantage is there to getting a practice exam?
- Format for Review Session
- A quick overview of the structure of the exam and what you will expect from us if we are given certain types of questions would allow us to know how to properly answer the questions to do well.
- If you could tailor the review session to resemble questions that will be on the exam, that would be really helpful. There is a lot of material to study, so being able to narrow it down to more specific examples of what kind of material we can expect to see on the exam would be helpful (multiple choice? short answer? finding runtimes?)
Content Questions about the Exam
The following questions come from the survey on CourseWeb.
- Fast Sorting Algorithms (43)
- Runtime (7)
- Still shaky on runtimes.
- Do not understand how to analysis the runtime exactly.
- I still struggle with calculating runtimes of more complicated samples of code, so doing more examples would be very helpful to me
- Calculating Runtimes the basics steps.
- I am a bit shaky on the topics of runtimes for the fast sorting algorithms, and how to analyze them. A brief review of the analysis of these fast sorting algorithms would be nice.
- Runtimes
- Algorithm Efficiency of Sorting Methods. (QuickSort, MergeSort, Shell Sort, etc) Please go over how to get the Big O(s)
- Description (4)
- I find it difficult to visualize how each algorithm actually sorts their respective data.
- Working through them is kind of hard, especially when they are recursive. WIth trees, lists, and queues, it's much easier to visualize the concept since you can draw them.
- There are just a lot of different ways to sort, an overview with all of them listed next to each other and key facts about each would be very helpful.
- for some how to implement or how to describe what's going on
- Differences/benefits (3)
- I have the most trouble remembering which one does which and the benefits of each.
- Hard to differentiate how each algorithm differs from the other
- In particular, I would like to review why certain algorithms are better depending on what type of data is being used. I would just like an explanation on why one would be better than another.
- Priority Queues and Heaps (39)
- More Review (4)
- We haven't spent much time on it, so I wouldn't feel confident answering a question on the topic. Spending time reviewing the basics would help me a lot.
- I think because this material is the newest it would be helpful to go over it a little bit more
- We didn't spend as much time on these so a little more review would be helpful.
- What is a Heap? Is it an ADT?
- Implementation Details (4)
- More code implementation examples
- Implementation details
- Implementation
- I'm not sure I fully understand the functionality of a Heap and/or the implementation of the data structure. I would like a review as to how Heaps are implemented and how they are used for data storage and manipulation.
- Runtime (2)
- In lecture you said the run time of finding the highest priority item in a Q (array implementation) and then removing it is EXACTLY n - you had a diagram of one drawn, and showed that it takes k compare operations to find the highest priority item (assuming the highest priority item is at the kth position), and then n - k operations to shift the rest of the items over. How can you find the highest priority item in k compares? Even after you arrive at the highest priority (kth) item, don't you still have to check it agains the remaining (n-k) items in the Q, leaving you with an n + (n - k) exact runtime? Did I miss something about the ordering of this Q such that you wouldn't have to do the rest of the compares?
- I think this is referring to when we talked about an unsorted array implementation of a priority queue. If that's the case, it would take exactly n operations to find the highest priority item (as you said). Then, it would take (n - k) operations to fill in the gap made by removing that item from the array (as you said). Therefore, it would take n + (n - k) = O(n) operations (as you said). I think you may have either missed the part where I said it was exactly n to find the max item or that it was O(n) for the whole operation. Or I happened to misspeak.
- I would like to review how runtimes compare for different implementations of heaps. I would like to see a tree diagram vs. an array to review this topic.
- Material from the Midterm (28)
- Runtime & Big O (5)
- BigO Notation - determining how different times are assigned to different functions
- Algorithm Runtime, Big-O notation
- Algorithm analysis, just finding the runtime of a method still gets confusing sometimes
- Big Os
- It's not that it's that difficult, but I haven't had to make use of the material recently so some of it is a bit fuzzy. Finding runtimes is sometimes difficult for more complex algorithms.
- Generics (2)
- Generics in general still confuse me. When and when you can't use them and what you can't use them with.
- I find bounded generics confusing. I'd like another overview of what they are in detail with examples.
- Recursion (1)
- I still find recursion difficult. I would like the class to review how to analyze a problem/algorithm for its base case and also what are some simple ways to write the recursive case or think about the recursive case.
- ADTs (1)
- I think that a review of Abstract Data Types would be very helpful to me
- Trees in general (24)
- General (5)
- The add and remove functions with respect to keeping the trees balanced.
- I found that the tree in general is confusing.
- Comparing the different types of trees and their runtimes
- How to implement them
- An overview of trees with just a little more emphasis on just the key aspects would be helpful.
- Traversals (2)
- Mostly the traversals. The major issue I have is that the buildInOrder (on the homework) method confused me to the point where I am unsure and not confident about my knowledge pertaining to the Tree data structure. I would just like a review of the traversal methods and how to build a tree using the methods provided in the Java API.
- I am confused with the runtime of traversals and other methods. Does it depend on the height of the tree and/or binary vs trinary?
- Iterators (2)
- I find iterators and tree traversal difficult concept. I'd like to see what tree traversal could be used to do and how iterators simplify to process. I'd also like to see what are some other uses for iterators beside traversal.
- Implementing an iterator
- Lists (10)
- Iterators
- In the notes regarding the Linked List implementation of an iterator, when the list only has one item: "with a single node reference, remove() is not possible. Why?" Is this because the iterator would just not have anything to point to? Couldn't you just set it to null, as you set the firstNode of the list to null? Does the null implementation just not support null references?
- No, it's because after you remove the node refered to by the iterator, you need to link up the list before that node to the list after that node. With just one reference in your iterator, you can't get the node before the one removed.
- Iterators
- Please go over list iterators in general
- General
- Not entirely knowledgeable about their generality
- In general.
- Binary Search Trees (9)
- I would like to review how deleting different nodes of a binary search tree is implemented. I would like to review this with a diagram in class with some examples.
- The recursive traversals of said trees.
- Removing a node from a binary search tree.
- I'd like to go over representing a BST with a linked list (regular, circular, and doubly linked)
- Binary Trees (8)
- Understanding the recursive methods that are used in binary trees
- Why doesn't the binary tree have an add operation? Could you make one that just finds the top-left-most node that is missing a child, and fill in that gap? The problem I see with that is that in order for the tree structure to have meaning, the user should really specify where to put a new node, and there for should be setting left or right children of the specific node to which their new node should be attached. Just filling the tree up arbitrarily seems like it wouldn't have any purpose...
- I think you answered your own question. With a generic tree, it's hard to know what it means to "add" a node to a tree without the user providing a specific location. Since trees are two dimensional, you can't just say "add to position 5". So instead we have
setLeftChild
and setRightChild
. The user of the class must find the node where they want to add the new node to, but once they do that, they can use one of those set child methods to add the new node.
- I am confused with the runtime of traversals and other methods. Does it depend on the height of the tree and/or binary vs trinary?
- Traversing through trees recursively isn't too difficult for me to write in code. However, I can't visualize it at all which can cause issues when I try to traverse trees. Especially with different order traversals (in,pre, and post order).
- Queues (5)
- the big idea of heaps and how priority ques work with binary trees.
- I'd like to review how to implement queues