Back to Topic 8.1 — Fundamentals of ADTs
8.1.3Computer Science HL5 flashcards

Building linked lists

Practice Flashcards

Flip to reveal answers
Card 1 of 58.1.3
8.1.3
Question

What two things define a linked list?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Building linked lists

Sign up free to track progress and get spaced-repetition review schedules.

Card 1definition

Question

What two things define a linked list?

Answer

A **Node** holding a value and a reference to the next, and a **head** reference pointing at the first node.

Card 2process

Question

In what order are the two references assigned when inserting?

Answer

**Point the new node forwards first** (new.next ← prev.next), then repoint the previous node (prev.next ← new). The other order overwrites the only reference to the rest of the list.

Card 3process

Question

How is a node deleted from a singly linked list?

Answer

By **routing around it**: prev.next ← target.next. Nothing is erased — the node simply becomes unreachable.

Card 4concept

Question

Why is deleting the head a special case?

Answer

There is no previous node to reroute, so the head itself moves: head = head.next.

Card 5process

Question

How does a traversal of a circular list stop?

Answer

When current returns to the **head**. There is no None to test for.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free
IB Computer Science Building linked lists Flashcards | 8.1.3 | Aimnova