DSAN 5500: Data Structures, Objects, and Algorithms in Python
Monday, April 15, 2024
Hofstadter’s Law (Paraphrase)
The pieces of your DSAN final project will take longer than you expect, even if you take Hofstadter’s Law into account
ThingContainer
.Linear | Logarithmic | Constant | ||
---|---|---|---|---|
LinkedList \(O(n)\) |
\(\rightarrow\) | BST \(O(\log_2(n))\) |
\(\rightarrow\) | HashTable \(O(1 + \varepsilon)\) |
Linear | Logarithmic | Constant | ||
---|---|---|---|---|
Insertion-Sort \(O(n^2)\) |
\(\rightarrow\) | Merge-Sort \(O(n\log_2(n))\) |
\(\rightarrow\) | ??? |
Multithreading | Asynchronous Execution | |
---|---|---|
Unconsciously (you do it already, “naturally”) |
Focus on one speaker within a loud room, with tons of other conversations entering your ears | Put something in oven, set alarm, go do something else, take out of oven once alarm goes off |
Consciously (you can do it with effort/practice) |
Pat head (up and down) and rub stomach (circular motion) “simultaneously” | Throw a ball in the air, clap 3 times, catch ball |
threading
multiprocessing
asyncio
find_prime_factors()
task…@task
annotation!DSAN 5500 Week 12: Final Projects, Interfaces