1 / 16

Exam 2 Review

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.

cmori
Download Presentation

Exam 2 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exam 2 Review EE 312 Software Design and Implementation I

  2. 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.

  3. Example Programming Problem • Given the description of the BST_312 at the end of the exam, write the recursive insert function.

  4. 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

  5. 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?

  6. 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.

  7. 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.

  8. 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?

  9. Trees • 40 Points • Definitions • Terminology: path, depth, height, etc. • General Trees vs. Binary Trees • Tree Traversals • Preorder • Inorder • Postorder • Binary Search Trees

  10. 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.

  11. 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.

  12. 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

  13. Not on this exam • Hashing • Code from book • Only concepts covered in class or on assignments

  14. 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.

  15. What to bring • Pencils and erasers • We will provide scratch paper • No calculators

  16. Questions

More Related