









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










A. Please speed up! B. I could go a bit faster C. I’m just keeping up D. A little slower would help E. Please slow down!
Let T(n) be a monotonically increasing function that satisfies: T(n) = aT(n/b) + Θ(n d^ ) Where a≥1, b>1, d≥0.
T(n) is Θ(n d^ ) if a < bd T(n) is Θ(n d^ log n) if a = bd T(n) is Θ(n log a b^ ) if a > bd
a is number of sub- problems 1/b is size of sub- problems nd^ is cost within a given level
Returns k th^ smallest element in list
Divide and conquer
Pick pivot, v
Create three sub-lists
Find which sub-list k is in from sub-list sizes
Return Selection(k (^2) , appropriate-sub-list)
Pick pivot, v
Construct 3 lists, SL, SV, SR
Quicksort(SL)
Quicksort(SR)
Return(SL,SV,SR) append now-sorted lists
If (S has one element) return S
Pick pivot, v
Construct 3 lists, S (^) L, SV, SR
SL = Quicksort(S (^) L)
SR = Quicksort(S (^) R )
Return(S (^) L,S (^) V,S (^) R ) append now-sorted lists
A. O(2n) B. O(n^2 ) C. O(n log n) D. O(n)
A. Omega(1) B. Omega(log n) C. Omega(n) D. Omega(n log n) E. Omega(n^2 )
for place = least to most significant
for item in list
calculate “digit” in item at place
add item to end of sublist[digit]
append all sublists back into list
Search and optimization heuristic
Mimics natural evolution Genome for candidate solutions Mutation, selection, inheritance, and crossover
http://www.youtube.com/watch?v=JBgG_VSP 7f8 (example of Karl Sims)
http://vimeo.com/ 12058493 (tribute)