Free Online Flashcard Deck

03 Linked Lists Free Online FlashCards

Study 03 Linked Lists with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is a linked list?

Back

A linked list is a linear structure of separate nodes connected by pointers or references; its nodes need not occupy contiguous memory.

02
Front

What fields does a singly linked node contain?

Back

A singly linked node stores data and a `next` link. The final node's `next` is conventionally `null` or `None`.

03
Front

What does the head reference identify?

Back

The `head` reference identifies the first node. In an empty list, `head` is `null` or `None`.

04
Front

What is the complexity of iterative list traversal?

Back

Iterative traversal takes O(n)O(n) time and O(1)O(1) extra space because it visits each of the nn nodes once.

05
Front

How do you insert a node at the front?

Back

Set `new.next = head`, then set `head = new`. This preserves access to the original list and takes O(1)O(1) time.

06
Front

How does a tail reference affect append complexity?

Back

With only `head`, appending takes O(n)O(n) because the last node must be found. With a maintained `tail`, it can take O(1)O(1).

07
Front

How do you insert after a known node?

Back

Set `new.next = current.next`, then `current.next = new`. Once `current` is known, the insertion takes O(1)O(1) time.

08
Front

What distinguishes a doubly linked node?

Back

A doubly linked node stores `data`, `prev`, and `next`, allowing traversal toward both the predecessor and successor.

09
Front

What is the complexity of removing a known doubly linked node?

Back

Once the target node is known, removing it takes O(1)O(1) time by reconnecting its predecessor and successor links. Locating it may take O(n)O(n).

10
Front

What defines a circular linked list?

Back

In a circular linked list, the final node links back to the first instead of storing `null`; for a circular singly linked list, `tail.next` is `head`.

11
Front

How should traversal stop in a circular list?

Back

Stop when `current == head` after processing the starting node, because a circular list never reaches `null`.

12
Front

Why is indexed access slow in a linked list?

Back

Access by index is generally O(n)O(n), because the implementation must follow links from the head to reach the requested position.