Data structures let us organize data, so that we can find answers efficiently.
For example, say you had to find all legos of the color red in Figure 1. Which case would be faster?
The second case is faster because the legos are organized. Similarly, in computer science, data structures let us organize data for quick retrieval.
Let us look at some data structures and their use cases.
Let’s say you visit a grocery store to buy bread. Which store would you prefer?