Skip to content

Chapter 2: Data Structures & Algorithms

Choose the right data structures and analyze algorithm complexity for AI workloads.


Metadata

Field Value
Track Foundation
Time 6 hours
Prerequisites Chapter 1 (Python Fundamentals)

Learning Objectives

  • Choose appropriate data structures for problems
  • Understand and analyze algorithm complexity (Big O)
  • Implement common algorithms efficiently
  • Work with arrays, stacks, queues, trees, and graphs
  • Apply sorting and searching algorithms
  • Use recursion and dynamic programming basics

What's Included

Notebooks

Notebook Description
01_introduction.ipynb Arrays, Big-O notation, searching algorithms
02_intermediate.ipynb Stacks, queues, sorting algorithms
03_advanced.ipynb Trees, graphs, dynamic programming

Scripts

  • Production-ready implementations of core data structures and algorithms

Exercises

  • 5 exercises with solutions (in solutions/ branch)

SVG Diagrams

  • 3 visual diagrams for structures and algorithm flow


Read Online

You can read the full chapter content right here on the website:

  • 02.1 Introduction -- Arrays, Big O notation, linear/binary search, two-pointer
  • 02.2 Intermediate -- Stacks, queues, hash tables, merge sort, quicksort
  • 02.3 Advanced -- Trees, graphs, BFS/DFS, dynamic programming, search index capstone

Or try the code in the Playground.

How to Use This Chapter

Quick Start

Follow these steps to get coding in minutes.

1. Clone and install dependencies

git clone https://github.com/luigipascal/berta-chapters.git
cd berta-chapters
pip install -r requirements.txt

2. Navigate to the chapter

cd chapters/chapter-02-data-structures

3. Launch Jupyter

jupyter notebook notebooks/01_introduction.ipynb

GitHub Folder

All chapter materials live in: chapters/chapter-02-data-structures/

Complete Chapter 1 First

This chapter builds on Python fundamentals. Complete Chapter 1 if you're new to Python.


Created by Luigi Pascal Rondanini | Generated by Berta AI