alphaPlan · Data Structures, Algorithms & the Web · Cheat-sheet 01
Getting oriented
A short bridge from the Python basics you know to the shape of your data: collections, structures, algorithms and objects.
Ideas to remember
- 01This course assumes you already use variables, if and else, for and while loops, functions and lists without looking them up.
- 02The focus shifts from single values to the shape of your data; a list is only one way to hold a group of items.
- 03Collections beyond the list are tuples, dictionaries and sets, and files let data outlive a single run of the program.
- 04Data structures such as stacks and queues are less about storage and more about the order in which items come back out.
- 05Algorithms are the step-by-step recipes that work on those structures, and the course adds a way to compare how well they scale.
- 06Two programs can give the same answer while doing wildly different amounts of work, and the difference often comes down to which structure holds the data.
Words
- collection
- A way to hold a group of items; the list is the first one most people meet.
- data structure
- A structure like a stack or a queue, defined by the order in which items come back out.
- algorithm
- A step-by-step recipe that works on a data structure.
- object-oriented design
- Bundling data and the actions on it into your own types.
Do this
- Write a short program from memory that averages a list of numbers; if any line feels shaky, revisit that topic in the Python course first.
- Ask one question of every new tool: what does it make easy, and what does it make hard?
- Treat what follows as new words in a language you can already speak.
Watch out
- The course does not re-teach the basics; steady them first if they feel shaky.
- Picking a data structure by accident instead of on purpose can leave you with a program that crawls when it could fly.
Found something unclear, outdated or improvable? Suggest an improvement