Skip to content

Preface

Vector drawingVector drawing

Preface

Undergraduate-level computer science (CS) programs typically teach data structures and algorithms (DSA) across one or two courses early in the program. The material is often divided into two phases. The first phase provides an introduction to foundational data structuring such as contiguous storage, indirection, custom typing, and hierarchical organization alongside basic algorithmic techniques such as sorting, searching, self-balancing structures, and elementary graph or string processing. The second phase builds on these concepts by providing more advanced algorithmic design material focused on increasingly complex real-world problem spaces. This module focuses primarily on the former, providing readers with a grounded introduction to data structuring and rudimentary algorithmic application with reference implementations in the Rust programming language.

DSA material itself is largely programming-language agnostic. Core concepts such as asymptotic analysis (which describes an algorithm’s logical growth tendency and spatial requirements) and algorithmic correctness depend on mathematical principles, formal proofs, and often even systems architectures or hardware constraints that hold true across programming languages. It is common to use pseudocode, a generic representation of high-level coding conventions, to describe algorithmic processes in both design and analysis. However, it is not possible to execute pseudocode directly, and providing concrete examples greatly accelerates the learning process. As a result, it is common to see DSA texts written with examples in a specific programming language.

Historically, the most common languages used in DSA courses have included Pascal, Lisp, C, and more recently C++, Java, and Python. Each one of these languages carries its own tradeoffs which mostly relate to design decisions and language philosophies that present different layers of complexity to code authors. Language preferences also reflect a given program’s priority on providing exposure to real-world language trends and usage.

Providing systems-language reference material fosters a deeper and more durable understanding of DSA by engaging readers with explicit reasoning about storage layouts, memory management, indirection, performance, and safety. For example, the techniques required to implement list structures from first principles form the backbone of much of the material presented in this module. Lists are not just useful on their own; they also provide an accessible foundation for exploring memory organization, traversal, mutation, and algorithmic behavior. The same concepts and tradeoffs reappear throughout the implementation of higher-level structures, either through shared language semantics or through the direct use of lists as fundamental storage mechanisms. By confronting these concepts directly instead of treating them as implementation details hidden behind high-level language abstractions, readers are better positioned to understand both the theoretical foundations of the material and their practical implications in real-world systems.

Among contemporary systems-level languages, the choice to use Rust was based in its strong emphasis on developer experience. Rust’s mature tooling ecosystem and rich compiler diagnostics provide an ergonomic and approachable systems programming experience.

Prerequisites

Similar to other DSA course materials, readers are generally expected to possess basic proficiency in writing and executing programs prior to engaging this module, but are not assumed to have mastery of either the Rust language or the underlying mathematical principles of DSA.

This module assumes the reader has some prior knowledge of Rust, and does not provide an explicit language primer. The canonical resource for learning Rust is The Rust Book by Steve Klabnik and Carol Nichols. I have also collected some notes on the subject with an attempt at a language primer which can be viewed as a parallel module on this site as The Rust Language. Klabnik’s book does not cover unsafe Rust with much depth, so you will likely find Aria Desires’ narrative work through The Rustnomicon and Learn Rust With Entirely Too Many Linked Lists essential.

The subject matter also draws on foundational mathematical concepts. Familiarity with algebra (summation, function modeling, etc.) and discrete mathematics (relations, set theory, graph theory, etc.) can further aid comprehension, but rigorous study of these domains is not strictly necessary. For readers with no formal discrete mathematics background, Susanna Epp’s Discrete Mathematics with Applications provides a fantastic reference.

Content Organization

This module is broken up into four primary data structure categories. Each category introduces new concepts that build on previously introduced elements, and is thus designed to be consumed linearly.

  1. The first chapter on sequential structures covers foundational in-memory data storage concepts. This chapter presents some of the most difficult Rust material in the module with Rust’s comparative ordering and unsafe memory management APIs. Some external language review is likely necessary to fully grok the implementation examples.

  2. The second chapter on keyed structures introduces the map and set structures, and illustrates how closely knit data structures and algorithms are by using previously introduced data storage concepts with additioanl logical layers to compose higher-level containers. This chapter introduces basic hashing and the module’s first sorted structure.

  3. The third chapter on hierarchical structures introduces self-referential data types used to build complex structures through indirection, which are most intuitively navigated by recursive traversal algorithms. This chapter provides a soft introduction to combinatorial graph structures, with implementation examples that cover various memory-safe design considerations for these complex types.

  4. The fourth chapter on relational structures covers combinatorial graph structures in a more detail and explores graph-based modeling techniques for representing real-world relationships and connectivity. This chapter is algorithm heavy and provides a strong jumping off point to a subsequent module on algorithm design techniques.

Disclosures

I feel that it is responsible to disclose that I have leveraged LLMs to help tighten up wording, improve structure, and support iterative design research for the module’s companion library. However, the ideas, analysis, and material presented here are my own.

As the sole author of this material I would much prefer to interact with a group of contributing editors and SMEs. If you find the subject matter interesting and would like to participate, or if you simply spot some glaring errors and want to set the record straight, please reach out!


© Peter Schmitz, 2026

This work is licensed under a Creative Commons (CC BY-NC-ND) 4.0 International License.