---
title: "Array representation vs dynamic list"
subject: "Data Structure and Algorithm"
chapter: 3
key: "semester_4/data_structure_and_algorithm:array-vs-dynamic-list"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/array-vs-dynamic-list
site: BCT Engineering
---

# Array representation vs dynamic list

Data Structure and Algorithm · Chapter 3: List

- Asked in: 2075 Baisakh, 4+2 marks
- Video: [Data Structures: Arrays vs Linked Lists](https://www.youtube.com/watch?v=lC-yYCOnN8Q) — mycodeschool
- 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/array-vs-dynamic-list
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-3

## Question

Explain array representation of list. How does it differ from dynamic list?

## Short answer

In array representation, elements are stored in consecutive memory locations with O(1) random access but insertion/deletion requires shifting and costs O(n). A dynamic linked list stores nodes anywhere in memory joined by pointers, allowing O(1) insert/delete after locating position but sequential O(n) access and extra pointer overhead.

## Answer

#### Array representation of a list

In array representation the elements of the list are stored in **consecutive memory locations** of an array. Element `i` is at address `base + i × size`, and the order of elements is given by the physical order. A variable `n` holds the current number of elements and `MAX` is the capacity.

```text
index:   0    1    2    3    4 ...  MAX-1
       | 10 | 20 | 30 | 40 |    |  ...  |
         n = 4
```

Operations: insertion at position k shifts elements k..n−1 one place right; deletion shifts them left; both take O(n). Access `a[i]` takes O(1).

#### Difference from a dynamic list (linked list)

| Array list | Dynamic list |
|---|---|
| Elements in contiguous memory | Nodes anywhere in memory, joined by pointers |
| Fixed maximum size | Grows and shrinks at run time |
| Order given by position | Order given by `next` links |
| Random access O(1) | Sequential access O(n) |
| Insert/delete needs shifting: O(n) | Insert/delete by changing pointers: O(1) after locating position |
| No pointer overhead | Extra pointer in each node |
| Memory wasted if array is large and list small | Memory used as needed |
| Overflow when array is full | Overflow only when no heap memory is left |

## Check yourself

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

1. How are elements of an array list stored?
   A. In scattered nodes
   B. In consecutive memory locations
   C. In a tree
   D. In a file
   Answer: B. Order is given by physical position. (Key point: Array storage)

2. Element i is at address:
   A. base + i x size
   B. base + i
   C. base x size
   D. base - i
   Answer: A. Consecutive locations give base + i x size. (Key point: Address of element)

3. In a dynamic list the order is given by:
   A. Physical position
   B. next links
   C. Index
   D. Sorting
   Answer: B. Nodes can be anywhere; links give the sequence. (Key point: Order in dynamic list)

4. Which is true for insert/delete?
   A. Array O(1), linked O(n) shifting
   B. Array needs shifting O(n); linked changes pointers O(1) after locating
   C. Both need shifting
   D. Both O(1) always
   Answer: B. Arrays shift elements, linked lists change pointers. (Key point: Insert/delete cost)

## Related in Data Structure and Algorithm

- [Array list; static or dynamic choice](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aarray-list-static-dynamic-reason) — Data Structure and Algorithm, chapter 3
- [Static and dynamic data structures; array list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astatic-dynamic-ds-array-list) — Data Structure and Algorithm, chapter 3
- [Static vs dynamic implementation of stack](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astack-static-vs-dynamic) — Data Structure and Algorithm, chapter 2
- [Static vs dynamic implementation of list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astatic-vs-dynamic-list-example) — Data Structure and Algorithm, chapter 3, asked 2×
- [Static vs dynamic list; getnode and freenode](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astatic-dynamic-list-getnode-freenode) — Data Structure and Algorithm, chapter 3

## Related in other subjects

- [Dynamic memory for object and object array](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Adynamic-memory-object-array) — Object Oriented Programming, chapter 3
- [Structure vs array; accessing members](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Astructure-vs-array-access-members) — Computer Programming, chapter 8
- [Data representation; analog vs digital system](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Adata-representation-analog-digital) — Data Communication, chapter 1
- [Linear array; broadside vs end fire](https://www.bctengineer.com/question.md?key=semester_6%2Fpropagation_and_antenna%3Alinear-array-broadside-endfire) — Propagation and Antenna, chapter 2
