Download presentation
Presentation is loading. Please wait.
Published byAubrey Casey Modified over 8 years ago
1
Exam 2 Review CS 3358 Data Structures
2
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 Exam Format
3
Given the ADT for the Stack_3358 at the end of the exam, implement the push, pop, isEmpty and isFull functions. Example Programming Problem
4
Given the following array, what would be the contents after the 4 th iteration of a insertion sort? 3 7 2 12 56 1 42 9 Example Tracing Problem
5
Why is the quick sort less efficient than the insertion sort for small lists (e.g. n < 20)? Example Short Answer
6
10 Points – Why? – Templated functions – Templated Classes – Understand the Stack Fun and Sort’em programs Templates
7
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(n 2 ), O (log 2 n) – Look for loops How fast does the problem shrink? Analysis of Algorithms (still important)
8
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 Stack ADT
9
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 Queue ADT
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(n 2 ) sorts Selection sort, Insertion sort – O(nlog 2 n) sorts Mergesort, Quicksort
12
Not on this exam Hashing Code from book Only concepts covered in class or on assignments
13
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. How to Study
14
Pencils and erasers We will provide scratch paper No calculators What to bring
15
Questions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.