← Course overview

Computer science foundations · 10 minutes

Choosing a data structure

Compare an array and a singly linked list. Explain access, memory layout and a realistic insertion tradeoff without claiming one is always better.

Study · reference notes

Explain array access

An array stores elements contiguously. With fixed-size elements and a known index, direct indexing can locate an element in constant time.

Explain linked traversal

A singly linked list stores nodes connected by next references. Finding the kth node usually requires walking through earlier nodes; nodes need not be contiguous.

Qualify insertion cost

Inserting after a known node can change a small number of references. Finding that node may still take linear time. Arrays and linked lists have different memory and access tradeoffs.

Read the primary teaching material: Harvard CS50: data structures ↗

Independent lesson notes · independent tutor review pending

Checking your account…

Sign in to save drafts, receive feedback and schedule reviews. Tutors see only work you submit to their assignments.

Sign in to practice