liveBook · Manning

Chapter 1: Starting a fabulous adventure

What you will learn in chapter 1 of Fabulous Adventures in Data Structures and Algorithms

This introduction frames the book as an exploration of unusual, useful algorithms and data structures that encourage more powerful, abstract, and enjoyable ways of solving programming problems.

After this chapter you will be able to

Section by section

Introduction

This introduction frames the book as an exploration of unusual, useful algorithms and data structures that encourage more powerful, abstract, and enjoyable ways of solving programming problems.

Key terms: algorithm, data structure, anti-unification, backtracking, Hughes list, HashLife algorithm, finger tree, immutable data structures, undo-redo, meaning

1.1 Defining data structures, algorithms, and complexity

This section defines data structures, algorithms, and complexity, then explains how Big O growth rates and real input conditions guide performance judgment.

Key terms: data structure, algorithm, deterministic, complexity, problem size, cost, Big O notation, asymptotic performance, O(1), O(log n)

1.2 An immutable linked list

Introduces a small immutable linked-list design, its recursive shape, and the trade-offs in representing emptiness and preserving valid states.

Key terms: linked list, empty, Value, Tail, immutable linked list, null reference, empty linked list, empty list, invalid state, invalid Tail

1.2.1 Performance so far

This subsection audits the immutable linked list’s current operations and exposes hidden performance costs in generated equality and naïve string construction.

Key terms: Push, O(1), O(n), extra memory, record classes, IEquatable<T>, equality operator, value equality, reference equality, recursive

1.2.2 Reversing an immutable linked list

This subsection reverses an immutable linked list by building a new list through repeated pushes, preserving the original and taking linear time and extra memory.

Key terms: Reverse method, immutable linked list, push, immutable, original list, O(n), time, extra memory

1.3 The challenges ahead

This section previews the book’s journey through unusual immutable data structures, developer-tool algorithms, probability tools, category-theory interludes, and the C#-based implementation approach.

Key terms: persistence, memoization, backtracking search, graph coloring, unification, anti-unification, immutable linked list, Hughes list, C#, category theory

1.4 Summary

This summary frames the book’s focus on unusual practical tools, recaps complexity tradeoffs, and notes that immutable linked lists make reversal straightforward.

Where this is used later

Concepts explained in this chapter

Chapter 2: Immutable stacks and queues →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.