CS252 Algorithms Wednesday, 16 November 2022 + Questions? + Habits for theoretical work - Develop intuitive understanding of an algorithm (concrete examples, play around with edge cases, be able to execute the algorithm by hand, etc.) - Study the correctness proof. Memorize the proof. Poke the proof with a stick (is there a better way? is this persuasive? what hypotheses does this statement depend on? etc.) - Compress the memorized proof. (e.g. Kruskal generates an MST by starting with N connected components and connecting two components per iteration as cheaply as possible; couldn't get cheaper (by contradition)) - Do the same stuff with the complexity analysis. - Where does a particular result fit within the structure of well-known theorems, lemmas, etc.? - What corollaries spin right out of this theorem? - What happens to the conclusion if I eliminate a hypothesis? What happens if I strengthen the hypothesis? - Play with the ideas! + Habits for practical work - Same as above, as far as you can. - Keep your eyes peeled for unnecessary N^2 behavior (example from CS257) - Read about your programming languages' behavior - Read about a new algorithm every month + Python