Exam 1 Review CS 3358
120 Total Points – 60 Points Writing Programs – 20 Points Tracing Algorithms, determining results, and drawing pictures – 40 Points Short Answer Similar to quizzes and programming assignments Note: the point values are approximations Exam Format
Write a function using the given header file for an array-based implementation of a doubly linked list that will remove the last item in the list. Example Programming Problem
Draw a picture that depicts the following? struct Node { int data; Node *next; Node *foo; }; … Node *hey; Node *temp = new Node; temp->data = 42; temp->foo = temp; temp->next = NULL; hey = temp; temp = new Node; temp->data = 13; temp->next = hey; Example Tracing Problem
What is the Big O time analysis of the insert operation in a doubly linked list when inserting before the cursor? Example Short Answer
25 Points – Multiple files Using header files – Command line arguments – OOP concepts. Especially those most useful for containers. Overloaded operators Copy constructors – Pointer variables – Understand the Climate and Go Fish programs Review of 2308
30 points – Don’t memorize definition – Does the amount of work depend on the size of the input? – Should be able to rank as faster or slower – Be able to analyze algorithms and code and determine Big O time analysis Especially most common. O(1), O(n), O(n 2 ), O (log 2 n) – Look for loops How fast does the problem shrink? Analysis of Algorithms
20 points – Know how to use it – Won’t need to implement any of it May need to do time analysis of a particular implementation – Don’t memorize any of the interface – Understand the Go Fish program Bag ADT
45 Points – Know the definition of the List ADT – May have to implement Array-based list Pointer-based linked list Array-based linked list Pointer-based doubly-linked list Array-based doubly-linked list – Be able to do the time analysis for any of the functions in the List ADT definition we used for the program – Understand the List ADT program List ADT
Not on this exam Templates Stacks Code examples from the book – Only what we covered in class and on the programs
Review the programs. – Rewrite them if you have time (especially the parts you had trouble with) Learn by doing and recognizing patterns. Use the exam for clues on the other problems and for help with syntax. Don’t stay up late!! Get some sleep and eat a good breakfast. How to Study
Pencils and erasers We will provide scratch paper No calculators What to bring
Questions