Programming Algorithms in Lisp: Writing Efficient Programs with Examples in ANSI Common Lisp

68 highlights · 10 notes
Highlights with my notes
Page 7“Complexity is a point that will be mentioned literally on every page of this book; the discussion of any algorithm or data structure can’t avoid this topic. After correctness, it is the second most important quality of every algorithm.”
My note Complexity & Correctness
Page 7“Moreover, often correctness alone doesn’t matter if complexity is neglected, while the opposite is possible: to compromise correctness somewhat in order to get significantly better complexity.”
My note Its possible to compromise correctness?
Page 7“algorithm theory differs from other subjects of CS in that it concerns not about presenting a working (correct) way to solve some problem but about finding an efficient way to do it, where efficiency is understood as the minimal (or admissible) number of operations performed and…”
My note Algorithms > Correctness AND complexity
Page 7“in most of the cases, measuring complexity is a matter of simple counting.”
My note Comexity is a matter of counting!!
Page 8“If we sum this all up, we’ll get n * m * 4 as an upper limit, for the worst case when each sequent array element is larger than the previous. As a rule of thumb, each loop adds multiplication to the formula, and each sequential block adds a plus sign.”
My note Each loop: multiplcation sign *
Each sequence : plus sign +
Page 8“There exists a special notation—Big-O—used to simplify the representation of end results of such complexity arithmetic. In it, all constants are reduced to 1, and thus m * 1 becomes just m, and also since we don’t care about individual array dimension differences, we can just…”
My note QUADRATIC Polynomial complexity
Page 8“There are six major complexity classes of algorithms: Constant-time (O(1)) Sublinear (usually, logarithmic—O(log n)) Linear (O(n)) and superlinear (O(n * log n)) Higher-order polynomial (O(nˆc), where c is some constant greater than 1) Exponential (O(cˆn), where c is usually 2…”
My note SIX COMPLEXITY CLASSES OF BIG O
Page 10“Finally, besides execution time complexity, there’s also space complexity, which instead of the number of operations measures the amount of storage space used proportional to the size of the input.”
My note EXECUTION TIME COMPLEXITY
SPACE COMPLEXITY
Page 12“Lisp programs consist of forms that are evaluated by the compiler.”
My note LISP EQUALS FORMS THAT ARE EVALUATED BY THE COMPILER
Page 12“three ways to evaluate a Lisp compound expression:”
My note Three ways to EVALUATE a compound expression
Highlights without notes
Scrambled, because I didn’t write a note on these: the words are the author’s, so here you only see where in the book I underlined something.
Page 7
Page 7
Page 8
Page 10
Page 12
Page 12
Page 12
Page 12
Page 12
Page 13
Page 14
Page 14
Page 14
Page 15
Page 15
Page 15
Page 15
Page 15
Page 15
Page 15
Page 16
Page 17
Page 17
Page 19
Page 20
Page 20
Page 20
Page 21
Page 21
Page 22
Page 22
Page 22
Page 23
Page 24
Page 24
Page 25
Page 25
Page 25
Page 26
Page 29
Page 29
Page 30
Page 30
Page 30
Page 30
Page 30
Page 30
Page 30
Page 31
Page 31
Page 31
Page 31
Page 32
Page 32
Page 32
Page 32
Page 33
Page 34