Data Structures
Knowing your data structures is an important part of programming! Using the right structure can make a huge difference in how efficient your code is, allowing you to solve more complicated problems in less time.
Any time you start learning a new language, tutorials will teach you how to use the most basic structures, but you'll be on your own for the more advanced concepts you'll need for more difficult problems.
With that in mind, I decided to make this series on using data structures in Haskell. We'll start with basics like lists, sets, and maps, but we'll also cover arrays, sequences and heaps, which you won't see in many tutorials but which are very useful for problem solving.
When you learn a structure, it can be a little overwhelming to keep track of all the API functions you'll want. In this series, we'll break each structure down into 10 Steps of Understanding.
- What operations does it support most efficiently? (What is it good at?)
- What is it not as good at?
- How many parameters does the type use and what are their constraints.
- How do I initialize the structure?
- How do I get the size of the structure?
- How do I add items to the structure?
- How do I access (or get) elements from the structure?
- If possible, how do I delete elements from the structure?
- How do I combine two of these structures?
- How should I import the functions of this structure?
This sounds like a lot of steps, but each step shouold be short! We'll just cover the most important functions in the API for that type. We'll start with the simplest types and work our way up!