Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
courses:cs211:winter2011:journals:charles:chapter2 [2011/01/27 07:09] – gouldc | courses:cs211:winter2011:journals:charles:chapter2 [2011/01/27 08:20] (current) – gouldc | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Chapter 2 -- Basics of Algorithm Analysis ====== | + | ====== Chapter 2: Algorithm Analysis ====== |
===== 2.1 Computational Tractability ===== | ===== 2.1 Computational Tractability ===== | ||
Line 16: | Line 16: | ||
===== 2.4 A Survey of Common Running Times ===== | ===== 2.4 A Survey of Common Running Times ===== | ||
+ | |||
+ | Introduces the notion that "a very small number of distinct reasons" | ||
* Linear time | * Linear time | ||
Line 24: | Line 26: | ||
* Beyond polynomial time (ex: 2^n and n!) | * Beyond polynomial time (ex: 2^n and n!) | ||
* Sublinear time | * Sublinear time | ||
+ | |||
+ | I am not great at determining the better bounds when you get into factorials and n^ks (confusing!). I was wondering: Say one algorithm (A) is super effective for n<100 but awful for n>=100. Another algorithm (B) is average: it is worse than A for n<100 but it's better than A for n>=100. Can you check the sample size at the beginning, and do algorithm A for n<100, algorithm B for n>=100? Is this ever the case? (My guess would be that sometimes you can't know the sample size, so assuming it will be large is appropriate.) | ||
===== 2.5 A More Complex Data Structure: Priority Queues ===== | ===== 2.5 A More Complex Data Structure: Priority Queues ===== | ||
- | A priority queue is a data structure designed to store elements with priority values. | + | Priority queues |