CS 310 Final Exam Review

CS 310 Final Exam Review - CS 310 Final Exam Review Furman...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 310  Final Exam Review Furman Haddix Ph.D. Assistant Professor Minnesota State University,  Mankato Spring 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unit 1 Simple Sort Examples Bubble Sort Insertion Sort Merge Sort Recurrence Tree Notation Running Time:  Θ (n) Floor and Ceiling Functions:   
Background image of page 2
Unit 2 Asymptotic Notation O(n) – “Big Oh” (or “Oh”) of n (n) – Omega (or “Big Omega”) of n Θ (n) – Theta of n o(n) – Little oh of n ϖ (n) – Little omega of n Solving Recurrence Relations Substitution method Recursion-tree method Master method
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Substitution Method The substitution method can be used for  establishing upper or lower bounds for a  recurrence relation The substitution method uses the following  steps: Guess the solution Prove the inductive step for the solution Prove the basis step for the solution
Background image of page 4
Recurrence-Tree  Method Example T(n) = 3T(n/4) +  Θ (n 2 ) cn 2 (3/16)cn 2 (3/16) 2 cn 2   … … …  … … … … … … … … … … … … … … … …  … … … … … … … … Θ (3 log 4 n )   T(1) T(1) T(1) T(1) T(1) T(1)    …   T(1) T(1) T(1) T(1)  T(1) T(1)  Θ (n log 4 3 T(n) = cn 2  + (3/16)cn 2  + (3/16) 2 cn 2  + (3/16) 3 cn 2  + … +  Θ (n log 4 3 log a T(n) cn 2 T(n/4) T(n/4) T(n/4) c(n/4) 2 T(n/16) T(n/16) T(n/16) c(n/4) 2 T(n/16) T(n/16) T(n/16) c(n/4) 2 T(n/16) T(n/16) T(n/16) c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2 c(n/16) 2
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Master Method – Another Recurrence  Tool Works for recurrences of the form: T(n) = a T(n/b) + f(n), where a   1, b > 1,  and f(n) is asymptotically positive    positive for n   n 0   Master Method: 1. If f(n) = O(n log b a- ε ) for some constant  ε  >0, then  T(n) =  Θ (n log b a ) 2. If f(n) =  Θ (n log b a ), then T(n) =  Θ (n log b a  lg n) 3. If f(n) =  (n log b a+ ε ) for some constant  ε  > 0, and if          a f(n/b)   cf(n) for some constant c > 1 and  sufficiently large n, then T(n) =  Θ (f(n)) Note that some recurrences appear to 
Background image of page 6
Unit 3 The divide-and-conquer design paradigm Merge sort Binary search Powering   number Fibonacci numbers VLSI tree layout
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Homework 1 Problem 2-4 in textbook
Background image of page 8
Homework 2 Problem 4-1 is due on Tuesday, February  5, 2008.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unit 4 Standard Tree Definitions Heaps Heapsort heapify() Priority Queues end-heapify()
Background image of page 10
Standard Tree Definitions full ternary tree (not complete, not perfect)
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Standard Tree Terminology Parents Children Left Children Right Children Root Leaf Branch,  Interior branch Descendants Ancestors
Background image of page 12
Homework 3 Due Wednesday, January 30
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 179

CS 310 Final Exam Review - CS 310 Final Exam Review Furman...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online