---
title: "Linked list has no random access"
subject: "Data Structure and Algorithm"
chapter: 4
key: "semester_4/data_structure_and_algorithm:linked-list-no-random-access"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/linked-list-no-random-access
site: BCT Engineering
---

# Linked list has no random access

Data Structure and Algorithm · Chapter 4: Linked lists

- Asked in: 2073 Magh, 2 marks
- Video: [Data Structures: Introduction to Linked Lists](https://www.youtube.com/watch?v=pBrz9HmjFOs) — ReelLearning
- 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/linked-list-no-random-access
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-4

## Question

In a linked list data cannot be accessed randomly. Justify with suitable example.

## Short answer

Nodes in a linked list are not contiguous in memory; there is no index formula. Accessing element k requires starting at the head and following next pointers k-1 times, which takess O(n) worst-case time, whereas arrays allow O(1) random access.

## Answer

In a linked list the nodes are scattered in memory, and the only way to reach a node is through the pointer stored in the node before it. There is no formula like `address = base + i × size` as in an array. To get the k-th node we must start at `start` and follow `next` k-1 times, so access takes O(k) time (O(n) worst case); an array gives A[k] in O(1).

Example: list `start -> [10] -> [20] -> [30] -> [40]`. To read the 4th element, we visit 10, 20, 30 and only then reach 40; we cannot jump directly to 40.

```c
p = start;
for (i = 1; i < 4; i++) p = p->next;   /* 3 steps */
printf("%d", p->info);                  /* 40 */
```
Hence data in a linked list cannot be accessed randomly, only sequentially.

## Check yourself

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

1. Why can't a linked list be randomly accessed?
   A. The only route to a node is via the previous node's next pointer
   B. Nodes are stored in sorted order
   C. Every node holds an index
   D. Memory is contiguous
   Answer: A. No address formula exists as with arrays. (Key point: Reason)

2. How many steps are needed to reach the k-th node?
   A. 1 step
   B. k-1 pointer moves, O(k)
   C. log k steps
   D. k^2 steps
   Answer: B. Start at the head and follow next each time. (Key point: Cost)

3. In list 10,20,30,40, how do we read 40?
   A. Jump directly to position 4
   B. Use base + 3 x size
   C. Visit 10, 20, 30 and then 40
   D. Start from the end
   Answer: C. Sequential traversal is the only way. (Key point: Example)

## Related in Data Structure and Algorithm

- [Polynomial addition using linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Apolynomial-addition-linked-list) — Data Structure and Algorithm, chapter 4, asked 3×
- [Types of linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Atypes-of-linked-list) — Data Structure and Algorithm, chapter 4, asked 2×
- [Insert and delete kth node in doubly linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adoubly-insert-delete-kth) — Data Structure and Algorithm, chapter 4, asked 2×
- [Doubly vs singly linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adoubly-vs-singly-linked) — Data Structure and Algorithm, chapter 4, asked 2×
- [Stack and queue using linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astack-queue-singly-linked-list) — Data Structure and Algorithm, chapter 4, asked 2×
- [ADT of linked list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aadt-linked-list-definition) — Data Structure and Algorithm, chapter 1

## Related in other subjects

- [Random access file transaction processing](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Arandom-access-transaction) — Object Oriented Programming, chapter 8
- [File I/O operations, errors, random access](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Afile-io-errors-random-access) — Computer Programming, chapter 10
- [Pixel access rate of raster system](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Apixels-per-second-access-time) — Computer Graphics, chapter 1
- [Star-delta transformer cannot parallel with star-star](https://www.bctengineer.com/question.md?key=semester_4%2Felectrical_machines%3Aparallel-star-delta-justify) — Electrical Machines, chapter 2
