Sign in

Data Structures

Data structures and algorithms, from core concepts to system design

Learn how data structures organise memory, how algorithms operate on that memory, and how to select complementary pairs to design scalable systems.

Plain words. One step at a time. Nothing here assumes you already know the idea.

The idea

A data structure is a specialised format for organising, processing, retrieving, and storing data in computer memory. An algorithm is a finite, step-by-step sequence of well-defined instructions designed to perform a specific computation or solve a given problem. While data structures represent passive arrangements of state, algorithms represent the active procedures that transform and query that state.

See it

Consider a public library.

1 of 5

You will need. Basic programming syntax in Python · Understanding variables, loops, and conditional statements

One pass

Step 1 of 3

Every program consists of two fundamental components: data and operations. A data structure answers the question of how information rests in memory. For instance, storing a group of user identifiers can be done in a contiguous list where elements sit next to each other, or in an associative mapping where each identifier maps directly to a location.

Smallest version

Linear search algorithm operating on an array data structure

def contains_item(data: list[int], target: int) -> bool:
    for item in data:
        if item == target:
            return True
    return False

numbers = [2, 4, 7, 9]
found = contains_item(numbers, 7)
print(found)

Keep these

  • A data structure stores and arranges elements in memory.
  • An algorithm executes a finite series of steps to compute a result over data.
  • An algorithm's implementation and efficiency directly depend on the underlying data structure.

Try one

Unsorted to set lookup

easy

Start the five-step lesson

Also on MonksBit