Data Structure
Data Structure
A system for organizing and arranging data neatly so computers can handle it efficiently.
In Simple Terms
A data structure is a pattern for organizing and arranging data in memory according to a fixed set of rules, so a computer can process lots of data efficiently. There are several standard types — some line information up in a single row, others connect it in a branching shape, and so on. By choosing the right type for the job, you can search for data quickly or process it in a specific order, depending on what you need to do.
Behind the Name
The "structure" in "Data Structure" captures the idea of taking scattered pieces of data and building them into an organized shape, following a set of rules, so a computer can quickly find what it needs later on.
Take a Closer Look!
A data structure is a pattern for organizing and arranging data in memory so a computer can work with it efficiently.
How you arrange the data has a huge effect on how easy it is to search for information, and how fast you can add new data.
A familiar comparison is how you arrange books on a bookshelf.
If you line books up by author, you can quickly find a specific author's books, but slotting a newly bought book into the right spot takes time.
On the other hand, if you just line books up in the order you bought them, a new book can go straight on the end, but finding a specific author's books becomes a hassle.
Broadly speaking, there are several standard types of data structure — an "array," which lines data up in a single row, and a "tree," which connects data in a branching shape, among others.
Programmers pick whichever type fits the job at hand, whether they need to search data quickly or process it in a specific order.