Data structures are the backbone of efficient software. Every application you use — from search engines to social networks to phone contacts — relies on carefully organized data structures to deliver results in milliseconds. In 2026, with AI assistants writing more code than ever, understanding data structures is what separates developers who can reason about performance trade-offs from those who just accept whatever the AI suggests.
Technical interviews at top tech companies still center on data structures and algorithms, and for good reason: they measure the ability to think in terms of efficiency, scalability, and clean design.
While there are plenty of resources to learn data structures, most either cost money or are aging. Few offer the combination of rigorous analysis, complete working code, and an open license that allows free sharing and adaptation.
About the book
Open Data Structures (in Java) covers the implementation and analysis of data structures for sequences, priority queues, unordered dictionaries, ordered dictionaries, and graphs. Written by Pat Morin, a professor at Carleton University, the book takes a mathematically rigorous approach while providing complete Java implementations for every structure discussed.
The book is designed for undergraduate computer science students and self-learners with some programming background. It assumes familiarity with basic Java syntax and object-oriented concepts, but walks through every data structure from first principles. Each chapter presents a problem, discusses the design options, implements a solution, and analyzes its time and space complexity with formal proofs where appropriate.
What makes this book unique is its open-source philosophy. The LaTeX source, Java code, and build scripts are all available on GitHub, and the book is released under a Creative Commons Attribution license — you can share it, adapt it, and even use it commercially with proper attribution.
What you will learn
- Array-based data structures: stacks, queues, and deques with dynamic resizing
- Linked lists: singly-linked, doubly-linked, and space-efficient variants
- Skiplists: a probabilistic alternative to balanced trees
- Hash tables: chaining, linear probing, and hash code design
- Binary trees: traversal, unbalanced search trees, and iterative operations
- Randomized trees: treaps and scapegoat trees with amortized analysis
- Red-black trees: simulating 2-4 trees for guaranteed logarithmic performance
- Heaps: binary heaps and randomized meldable heaps
- Sorting algorithms: merge-sort, quicksort, heap-sort, counting sort, and radix sort
- Graphs: adjacency matrix and adjacency list representations, BFS and DFS traversal
- Integer data structures: binary tries, x-fast tries, and y-fast tries
- External memory structures: B-trees and the block store model
Table of contents
- 1. Introduction
- 2. Array-Based Lists
- 3. Linked Lists
- 4. Skiplists
- 5. Hash Tables
- 6. Binary Trees
- 7. Random Binary Search Trees
- 8. Scapegoat Trees
- 9. Red-Black Trees
- 10. Heaps
- 11. Sorting Algorithms
- 12. Graphs
- 13. Data Structures for Integers
- 14. External Memory Searching
Book details
- Title: Open Data Structures (in Java)
- Author(s): Pat Morin
- Publisher: Self-published (Open Data Structures Project)
- Pages: 291
- PDF size: 1.91 MB
- Estimated reading time: ~7 h 17 min
- Level: Intermediate
- Main category: Programming
- Subcategory: Java
- Language: English
- License: Creative Commons Attribution (CC BY)
More books in: Java, Programming
Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.