160 likes | 168 Views
This review covers topics such as writing programs, tracing algorithms, short answer questions, OOP, STL, templates, analysis of algorithms, trees, recursion, sorting, and studying tips.
E N D
Exam 2 Review EE 312 Software Design and Implementation I
Exam Format • 110 Total Points • 40 Points Writing Programs • 20 Points Tracing Algorithms, determining results, and drawing pictures • 50 Points Short Answer • Note: These point values are approximations • Note: The values on the categories will not add up to the total points because categories overlap.
Example Programming Problem • Given the description of the BST_312 at the end of the exam, write the recursive insert function.
Example Tracing Problem • Given the following array, what would be the contents after the 3rd iteration of a selection sort? 3 7 2 12 56 1 42 9
Example Short Answer • Explain a reasonable way to choose the pivot for a quicksort if you do not know the relative order of the elements in the data? • What is the Big O time of inserting an element into a binary search tree?
OOP, STL,Templates • 30 Points • Class structure • Instance and Class variables • Understand Constructors and Destructors • Default and overridden • How and when they are called • Calling instance functions • How to override relational operators and why they are necessary for container classes.
OOP, STL,Templates (cont.) • Templated Classes and Functions • You will not have to write any template code. • How to use vectors. • Understand the UtPod and Go Fish programs.
Analysis of Algorithms (still important) • 10 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?
Trees • 40 Points • Definitions • Terminology: path, depth, height, etc. • General Trees vs. Binary Trees • Tree Traversals • Preorder • Inorder • Postorder • Binary Search Trees
Trees (cont.) • Binary Search Tree • Insert • Delete • Find • Count Nodes • Be able to code anything from BST_312 • Make sure you understand the recursive and iterative solutions for each function.
Recursion • 30 Points • Understand • Base case • Smaller caller • General case • Will have to write a recursive functions • Be able to do time analysis of a recursive function • Understand math stuff, recursive flood fill and the BST programs.
Sorting • 20 Points • Algorithms • Will not have to code the sorts from scratch • Know the algorithms REALLY WELL! • Will likely have to draw, trace, or produce psuedo-code • Time and space considerations • O(n2) sorts • Selection sort, Insertion sort • O(nlog2n) sorts • Mergesort, Quicksort
Not on this exam • Hashing • Code from book • Only concepts covered in class or on assignments
How to Study • Review the programs. • Rewrite them if you have time (especially the parts you had trouble with) • Look at sorts in a lot of detail. • Look at other recursive functions (BSTs, linked lists, etc.) • 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