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

# Primitive vs non-primitive data structure

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

- Asked in: 2073 Bhadra, 4 marks
- Video: [Primitive vs Non-Primitive Data Structures Explained 🔥 (With Real-World Examples!)](https://www.youtube.com/watch?v=ZNHZG32q_l4) — Codewiz
- 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/primitive-vs-nonprimitive
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-1

## Question

Differentiate between primitive and non-primitive data structure.

## Short answer

Primitive data structures are basic language types storing a single value with fixed size, like int or char; non-primitive structures are derived from them, store collections of values, can be linear (array, list) or non-linear (tree, graph), and may have dynamic size.

## Answer

**Primitive data structures** are the basic data types provided by the language and directly operated on by machine instructions. **Non-primitive data structures** are derived from primitive ones and store collections of related values.

| Primitive | Non-primitive |
|---|---|
| Basic types defined by the language | Derived (user-defined) from primitive types |
| Hold a single value | Hold a collection of values, possibly of different types |
| Examples: int, float, char, boolean, pointer | Examples: array, stack, queue, linked list, tree, graph, struct |
| Size is fixed by the machine/compiler | Size may be fixed (array) or change at run time (list) |
| Operated on directly by machine instructions | Need user-written functions or algorithms |
| Not divisible into smaller data types | Can be divided into simpler components |
| Store data in one memory location | Store data in a number of related locations |

## Check yourself

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

1. How do primitive and non-primitive structures differ in what they hold?
   A. Primitive holds a collection; non-primitive holds a single value
   B. Both hold only one value
   C. Primitive holds only strings
   D. Primitive holds a single value; non-primitive holds a collection
   Answer: D. Primitive types store one value; non-primitive ones store collections of related values. (Key point: Values held)

2. How are non-primitive structures operated on?
   A. Through user-written functions or algorithms
   B. Directly by machine instructions
   C. Only by the compiler
   D. They cannot be operated on
   Answer: A. Primitive types are handled directly by the machine; non-primitive need user-defined algorithms. (Key point: Operation method)

3. Which list contains only non-primitive structures?
   A. Array, stack, tree, graph
   B. int, float, array, tree
   C. char, pointer, queue, boolean
   D. Stack, int, graph, list
   Answer: A. Primitive: int, float, char, boolean, pointer. Non-primitive are derived from them. (Key point: Examples)

## Related in Data Structure and Algorithm

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