130 likes | 139 Views
Exam 1 Review. CS 3358. Exam Format. 100 Total Points 60 Points Writing Programs 10 Points Tracing Algorithms, determining results, and drawing pictures 30 Points Short Answer Similar to quizzes and programming assignments Note: the point values are approximations.
E N D
Exam 1 Review CS 3358
Exam Format • 100 Total Points • 60 Points Writing Programs • 10 Points Tracing Algorithms, determining results, and drawing pictures • 30 Points Short Answer • Similar to quizzes and programming assignments • Note: the point values are approximations
Example Programming Problem • 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 Tracing 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 Short Answer • What is the Big O time analysis of the insert operation in a doubly linked list when inserting before the cursor?
Review of 2308 • 15 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
Analysis of Algorithms • 25 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(n2), O (log2n) • Look for loops • How fast does the problem shrink?
Vector ADT • 15 points • Know how to use it • Including finding the size, moving through the elements as if it were an array • Won’t need to implement any of it • May need to do time analysis of a particular implementation • Will not need to use any iterators • Understand the Go Fish program
List 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
Not on this exam • Templates • Stacks • Code examples from the book • Only what we covered in class and on the programs
How to Study • 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.
What to bring • Pencils and erasers • We will provide scratch paper • No calculators