Part Two
[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 download
Related searches
- two part baby girl names
- two part names for girls
- two year s experience or two years experience
- two year s experience or two years exper
- ielts speaking part two questions
- two variable two equation solver
- two equations two unknowns calculator
- two equations two unknowns
- solving two equations two unknowns
- two equations two unknowns solver
- part two synonym
- two people or two persons