Part Two - Stanford University
[Pages:47]Divide-and-Conquer Algorithms
Part Two
Recap from Last Time
Divide-and-Conquer Algorithms
A divide-and-conquer algorithm is one that works as follows:
(Divide) Split the input apart into multiple smaller pieces, then recursively invoke the algorithm on those pieces.
(Conquer) Combine those solutions back together to form the overall answer.
Can be analyzed using recurrence relations.
Two Important Recurrences
TT((00))==((11)) TT((11))==((11)) TT((nn))==TT((nn//22))++TT((nn//22))++((nn))
Solves to O(n log n)
TT((00))==((11)) TT((11))==((11)) TT((nn))TT((nn//22))++((11))
Solves to O(log n)
Outline for Today
More Recurrences
Other divide-and-conquer relations.
Algorithmic Lower Bounds
Showing that certain problems cannot be solved within certain limits.
Binary Heaps
A fast data structure for retrieving elements in sorted order.
Another Algorithm: Maximizing Unimodal Arrays
Unimodality
AAnnaarrrraayyisisccaallleledduunniimmooddaall ififffititccaannbbeessppliltitininttooaann
ininbcbcryryeeaaaasdsdieniencgcgrreseseaeaqsqsiuniunegengnscsceeeeqqfufouoelellnolnocwcweee.e.dd
1 3 4 5 7 8 10 12 13 14 10 9 6 2
pprroioicfcfeedlrdlruoeuoerwtrwteueu=r=rnunuhnhniiAiiAg[mg[mholholdodo-aw-awl]l]1M1M:a:axx((lliisstt AA,, iinntt llooww,, iinntt hhiigghh))::
lielieeflefltstseArreArr[mee:[mee:mittmittduuiduuidrrdrr]=nn]=nn
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- stanford university philosophy department
- stanford university plato
- stanford university encyclopedia of philosophy
- stanford university philosophy encyclopedia
- stanford university philosophy
- stanford university ein number
- stanford university master computer science
- stanford university graduate programs
- stanford university computer science ms
- stanford university phd programs
- stanford university phd in education
- stanford university online doctoral programs