Data structures: definitions and classification
What a data structure is, and the family tree you need for every "classify data structures" question.
Syllabus says: “Basic Concepts of Data Structures — Definitions”
On this page · 10 sections
LINEAR = standing in a LINE. NON-LINEAR = a family NETWORK.
A sadhya leaf: items are served one after another along the leaf (linear). A family WhatsApp group: everyone is connected to many people (non-linear).
A data structure is a way of organising data in memory together with the operations allowed on it, so that the data can be used efficiently.
ഒരു വരിയിൽ = linear · വല പോലെ = non-linear
What you will be able to do
- Define a data structure in one exam-ready sentence.
- Classify data structures: primitive / non-primitive, linear / non-linear, static / dynamic.
- List the basic operations every data structure supports.
The story
Your room has the same things whether they are thrown on the bed or arranged on a shelf, but finding your hall ticket takes 5 seconds in one case and 15 minutes in the other. Data in a program is the same: how it is arranged decides how fast you can find, add or remove things. That arrangement, together with the operations you can perform on it, is a data structure.
Definition
A data structure is a particular way of storing and organising data in memory, together with the set of operations allowed on it, so that the data can be accessed and modified efficiently.
Program = Algorithm + Data structure (Niklaus Wirth). Choosing the right structure often matters more than clever code.
The family tree (classification)
| Type | Meaning | Examples |
|---|---|---|
| Primitive | Built into the language; the CPU handles them directly | int, float, double, char, pointer |
| Non-primitive | Built from primitive types | array, structure, list, tree, graph |
| Linear | Elements form a sequence; each has one predecessor and one successor (except the ends) | array, stack, queue, linked list |
| Non-linear | An element may connect to many others; no single sequence | tree, graph |
| Static | Size fixed at compile time | int a[100] |
| Dynamic | Size changes at run time (malloc/free) | linked list, dynamically built tree |
Operations on a data structure
- Traversal — visit every element once.
- Search — find an element with a given value.
- Insertion — add an element.
- Deletion — remove an element.
- Sorting — arrange in order.
- Merging — combine two structures into one.
“The Smart Indian Doctor Should Marry” — Traverse, Search, Insert, Delete, Sort, Merge.
Where each kind shows up
| Need | Structure |
|---|---|
| Undo in an editor | stack |
| Printer jobs in arrival order | queue |
| Folders inside folders | tree |
| Roads between cities, Google Maps | graph |
| Marks of 60 students | array |
Common mistakes
- Calling an array ‘dynamic’ — a C array declared with a fixed size is static.
- Putting linked lists under non-linear — a linked list is still a sequence, so it is linear.
- Defining a data structure without mentioning operations.
Quick check — can you get them all?
Practice
Every visualizer has a Practice mode: predict the next state before the animation reveals it. You can also work through the topic's question set on the practice page.
Exam-ready summary
- Data structure = organisation of data + allowed operations.
- Primitive vs non-primitive; linear (array, stack, queue, list) vs non-linear (tree, graph); static vs dynamic.
- Operations: traverse, search, insert, delete, sort, merge.
References
- Horowitz, Sahni & Anderson-Freed, Fundamentals of Data Structures in C, 2/e — Ch. 1
- Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 3/e — Part III introduction
Explanations on this page are original. Textbook references point to where the standard treatment can be read; no text is reproduced from them.
Prefer revising from notes? Module-wise notes and question papers on Azhimathi Mayam (opens in a new tab)