1 / 15

Data Structures Exam Review: Programming, Tracing, and Short Answer Questions

This exam review covers programming problems, tracing algorithms, and short answer questions on topics such as stack ADT, recursion, sorting, and analysis of algorithms.

tonyb
Download Presentation

Data Structures Exam Review: Programming, Tracing, and Short Answer Questions

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 CS 3358 Data Structures

  2. Exam Format • 90 Total Points • 50 Points Writing Programs • 25 Points Tracing Algorithms, determining results, and drawing pictures • 15 Points Short Answer • Similar to quizzes and programming assignments • Note: the point values are approximations

  3. Example Programming Problem • Given the ADT for the Stack_3358 at the end of the exam, implement the push, pop, isEmpty and isFull functions.

  4. Example Tracing Problem • Given the following array, what would be the contents after the 4th iteration of a insertion sort? 3 7 2 12 56 1 42 9

  5. Example Short Answer • Why is the quick sort less efficient than the insertion sort for small lists (e.g. n < 20)?

  6. Templates • 10 Points • Why? • Templated functions • Templated Classes • Understand the Stack Fun and Sort’em programs

  7. Analysis of Algorithms (still important) • 8 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?

  8. Stack ADT • 30 points • Understand basic functions • Push • Pop • IsEmpty • isFull • Should be able to implement array or linked list version of stack • Be able to use a stack to solve a problem • How does a stack relate to recursion? • Understand Stack Fun assignment

  9. Queue ADT • 0 Points • Know the basic functions • Enqueue • Dequeue • isFull • isEmpty • Be able to implement circular array-based queue • Be able to implement a linked list version of a queue

  10. Recursion • 25 Points • Understand • Base case • Smaller caller • General case • Will have to write a recursive function • Be able to do time analysis of a recursive function • Understand math stuff and recursive flood fill

  11. Sorting • 35 Points • Algorithms • Will not have to code the sorts • 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

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

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

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

  15. Questions

More Related