Data Structure
PronunciationDAY-tuh STRUK-cher
Definition
A data structure is a way of organising data in memory so it can be used efficiently, such as a list, a dictionary, a set or a tree.
Where you hear it
In computer science courses, coding interviews, and performance discussions about choosing between a list and a dictionary.
Examples
Choosing the right data structure turned a slow search into an instant lookup.
A set is the best data structure for checking membership quickly.
A hash table is a data structure that gives fast lookups by key.
Common mistake
Picking a structure by habit. Each one is fast at some operations and slow at others, so choose by how you will use the data.
Don't confuse with
An algorithm, which is the steps that process data. The data structure is how the data is arranged.
Say it at work
- In a meeting or chat
A dictionary is a better data structure than a list for this lookup.
- In an email or ticket
Let's pick the data structure before writing the loop.
Keep exploring
More in Programming Fundamentals