---
title: "Data structure; primitive vs non-primitive"
subject: "Data Structure and Algorithm"
chapter: 1
key: "semester_4/data_structure_and_algorithm:define-ds-primitive-nonprimitive"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/define-ds-primitive-nonprimitive
site: BCT Engineering
---

# Data structure; primitive vs non-primitive

Data Structure and Algorithm · Chapter 1: Concept of data structure

- Asked in: 2072 Magh, 2+2 marks
- Video: [Introduction, Types of DS (Primitive & Non Primitive) | Data Structures](https://www.youtube.com/watch?v=7wWfdTGWHm4) — Dr. Ankit Verma
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/define-ds-primitive-nonprimitive
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-1

## Question

Define a data structure and also write down the difference between primitive data structure and non-primitive data structure.

## Short answer

A data structure organizes and stores data for efficient access and manipulation. Primitive structures are built-in types holding one value (int, float) with machine-operated operations, while non-primitive structures are user-defined, hold collections, and require algorithms; they are linear or non-linear.

## Answer

A **data structure** is a particular way of organising and storing data in the memory of a computer so that it can be accessed, searched and modified efficiently. It also includes the set of operations defined on the organised data. Examples: array, stack, queue, linked list, tree, graph.

#### Primitive vs non-primitive data structures

| Primitive | Non-primitive |
|---|---|
| Basic types built into the language | Derived from primitive types |
| Store one value of a single type | Store a collection of values |
| Examples: int, float, char, pointer | Examples: array, stack, queue, list, tree, graph |
| Operated on directly by the machine | Operated on through user-defined algorithms |
| Fixed size decided by the compiler | Fixed (array) or dynamic (linked list) |
| Cannot be broken into simpler types | Can be broken into simpler components |

Non-primitive structures are further divided into **linear** (array, list, stack, queue) and **non-linear** (tree, graph).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. A data structure is:
   A. A single built-in variable type
   B. A way of organising and storing data for efficient access and modification, with defined operations
   C. A compiler optimisation
   D. A type that cannot be broken down
   Answer: B. It organises data in memory and includes operations on that data. (Key point: Definition)

2. Which is true about size?
   A. Primitive size is fixed by the compiler; non-primitive may be fixed or dynamic
   B. Primitive size changes at run time
   C. Non-primitive size is always fixed
   D. Both always change at run time
   Answer: A. Array is fixed, linked list is dynamic; primitive sizes are fixed by the compiler. (Key point: Size difference)

3. Which statement about breaking into components is correct?
   A. Primitive types can be broken into simpler types
   B. Neither can be broken down
   C. Only int can be broken down
   D. Non-primitive structures can be broken into simpler components
   Answer: D. Primitive types are not divisible into smaller types; non-primitive ones are. (Key point: Division)

4. Non-primitive structures are further divided into:
   A. Linear and non-linear
   B. Static and primitive
   C. Built-in and compiled
   D. Integer and real
   Answer: A. Linear: array, list, stack, queue. Non-linear: tree, graph. (Key point: Linear vs non-linear)

## Related in Data Structure and Algorithm

- [Primitive vs non-primitive data structure](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aprimitive-vs-nonprimitive) — Data Structure and Algorithm, chapter 1
