Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exam 2 Review CS 3358 Data Structures.

Similar presentations


Presentation on theme: "Exam 2 Review CS 3358 Data Structures."— Presentation transcript:

1 Exam 2 Review CS 3358 Data Structures

2 Exam Format 100 Total Points
55 Points Writing Programs 30Points 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 selection sort?

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)
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?

8 Stack ADT 20 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 15 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 Will have to write a recursive function
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 30 Points Algorithms Time and space considerations O(n2) sorts
Will not have to code the sorts Know the algorithms REALLY WELL! Will likely have to draw or trace 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 other recursive functions (linked lists, etc.) 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.

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

15 Questions


Download ppt "Exam 2 Review CS 3358 Data Structures."

Similar presentations


Ads by Google