liveBook · Manning

What you will learn in Grokking Data Structures

by Marcello La Rocca

Chapter by chapter

Chapter 1: Introducing data structures: Why you should learn about data structures

1.1 Welcome to Grokking Data Structures · 1.2 Data structures are everywhere · 1.3 Data structures are for everyone · 1.4 What are data structures? · 1.5 Why should I care about data structures? · 1.6 Will I ever write code for these data structures? · 1.7 How should I choose a data structure? · 1.8 How do we use data structures in a project? · 1.9 A mental model for applying data structures · 1.10 Data structures in action · 1.11 Recap

What you learn in chapter 1 →

Chapter 2: Static arrays: Building your first data structure

2.1 What is an array? · 2.2 When do I need an array? · 2.3 Definitions: Statically vs. dynamically sized · 2.4 Values and indexes · 2.5 Initialization · 2.6 Arrays in Python · 2.7 Python lists vs. the array.array class · 2.8 Indexing · 2.9 Operations on arrays · 2.10 A class for unsorted arrays · 2.11 Adding a new entry · 2.12 Removing an entry · 2.13 Searching for a value · 2.14 Traversal · 2.15 Arrays in action · 2.16 Statistics · 2.17 Collections · 2.18 Multidimensional arrays · 2.19 Recap

What you learn in chapter 2 →

Chapter 3: Sorted arrays: Searching faster, at a price

3.1 What’s the point of sorted arrays? · 3.2 The challenge of the search ninja · 3.3 Implementing sorted arrays · 3.4 Insert · 3.5 Delete · 3.6 Linear search · 3.7 Binary search · 3.8 Recap

What you learn in chapter 3 →

Chapter 4: Big-O notation: A framework for measuring algorithm efficiency

4.1 How do we choose the best option? · 4.2 Profiling · 4.3 Asymptotic analysis · 4.4 Which one should I use? · 4.5 Big-O notation · 4.6 The RAM model · 4.7 Growth rate · 4.8 Common growth functions · 4.9 Growth rate in the real world · 4.10 Big-O arithmetic · 4.11 Worst-case vs. average vs. amortized analysis · 4.12 Measured resources · 4.13 An example of asymptotic analysis · 4.14 Linear search · 4.15 Binary search · 4.16 Recap

What you learn in chapter 4 →

Chapter 5: Dynamic arrays: Handling dynamically sized datasets

5.1 The limitations of static arrays · 5.2 Fixed size · 5.3 Tradeoffs · 5.4 How can we grow an array’s size? · 5.5 The trophy case · 5.6 Strategy 1: Grow by one element · 5.7 Strategy 2: Grow by X elements · 5.8 Strategy 3: Double the size · 5.9 Comparing the strategies · 5.10 Applying the strategies to arrays · 5.11 Should we also shrink arrays? · 5.12 Halve on delete · 5.13 Smarter shrinking · 5.14 Implementing a dynamic array · 5.15 The DynamicArray class · 5.16 Insert · 5.17 Find · 5.18 Delete · 5.19 Recap

What you learn in chapter 5 →

Chapter 6: Linked lists: A flexible dynamic collection

6.1 Linked lists vs. arrays · 6.2 Under the hood of a linked list · 6.3 Arrays and linked lists: A comparison · 6.4 Singly linked lists · 6.5 Orders management · 6.6 Implementing singly linked lists · 6.7 Insert · 6.8 Search · 6.9 Delete · 6.10 Delete from the front of the list · 6.11 Sorted linked lists · 6.12 Insert in the middle · 6.13 Can we improve search? · 6.14 Doubly linked lists · 6.15 Twice as many links, twice as much fun? · 6.16 The importance of retracing your steps · 6.17 Insert · 6.18 Search and traversal · 6.19 Delete · 6.20 Concatenating two lists · 6.21 Circular linked lists · 6.22 Examples of circular linked lists · 6.23 Implementation tips · 6.24 Recap

What you learn in chapter 6 →

Chapter 7: Abstract data types: Designing the simplest container—the bag

7.1 Abstract data types vs. data structures · 7.2 Definitions · 7.3 Arrays and linked lists: ADT or DS? · 7.4 One more example: The light switch · 7.5 Containers · 7.6 What’s a container? · 7.7 What isn’t a container? · 7.8 Key features of containers · 7.9 The most basic container: The bag · 7.10 Definition of bag · 7.11 Bags in action · 7.12 Implementation · 7.13 Recap

What you learn in chapter 7 →

Chapter 8: Stacks: Piling up data before processing it

8.1 Stack as an ADT · 8.2 Stack and LIFO · 8.3 Operations on a stack · 8.4 Stacks in action · 8.5 Stack as a data structure · 8.6 Static array for storing a stack’s data · 8.7 Dynamic array · 8.8 Linked lists and stacks · 8.9 Linked list implementation · 8.10 Push · 8.11 Pop · 8.12 Peek · 8.13 Theory vs. the real world · 8.14 More applications of a stack · 8.15 The call stack · 8.16 Evaluating expressions · 8.17 Undo/redo · 8.18 Retracing your steps · 8.19 Recap

What you learn in chapter 8 →

Chapter 9: Queues: Keeping information in the same order as it arrives

9.1 Queue as an abstract data type · 9.2 First in, first out · 9.3 Operations on a queue · 9.4 Queues in action · 9.5 Queue as a data structure · 9.6 Building on a linked list · 9.7 Storing data in a static array · 9.8 A comparison of the possible implementations · 9.9 Implementation · 9.10 An underlying static array · 9.11 Enqueue · 9.12 Dequeue · 9.13 What about dynamic arrays? · 9.14 More applications of a queue · 9.15 Messaging systems · 9.16 Web servers · 9.17 Operating systems · 9.18 Recap

What you learn in chapter 9 →

Chapter 10: Priority queues and heaps: Handling data according to its priority

10.1 Extending queues with priority · 10.2 Handling bugs (revised) · 10.3 The abstract data type for priority queue · 10.4 Priority queues as data structures · 10.5 Sorted linked lists and sorted arrays · 10.6 Unsorted linked lists and unsorted arrays · 10.7 Performance overview · 10.8 Partial ordering · 10.9 Heap · 10.10 A special tree · 10.11 Some properties of a heap · 10.12 Performance of a heap · 10.13 Max-heap and min-heap · 10.14 Implementing a heap · 10.15 How to store a heap · 10.16 Constructor, priority, and helper methods · 10.17 Insert · 10.18 Top · 10.19 Heapify · 10.20 Priority queues in action · 10.21 Find the k largest entries · 10.22 Recap

What you learn in chapter 10 →

Chapter 11: Binary search trees: A balanced container

11.1 What makes a tree? · 11.2 Definition of a tree · 11.3 From linked lists to trees · 11.4 Binary trees · 11.5 Some applications of trees · 11.6 Binary search trees · 11.7 Order matters · 11.8 Search · 11.9 Find the minimum and maximum · 11.10 Insert · 11.11 Delete · 11.12 Putting it all together · 11.13 Traversing a BST · 11.14 Predecessor and Successor · 11.15 Balanced trees · 11.16 Binary search trees in action · 11.17 Adversary insertion sequences · 11.18 Deletions make your tree skewed · 11.19 Tree balancing · 11.20 Recap

What you learn in chapter 11 →

Chapter 12: Dictionaries and hash tables: How to build and use associative arrays

12.1 The dictionary problem · 12.2 Removing duplicates · 12.3 The ADT for dictionaries · 12.4 Data structures implementing a dictionary · 12.5 Array · 12.6 Linked List · 12.7 Balanced Binary Search Tree · 12.8 Summary · 12.9 Hash tables · 12.10 A new way of indexing · 12.11 The cost of indexing · 12.12 Problems with the ideal model · 12.13 Hashing · 12.14 Hash functions · 12.15 The division method · 12.16 The multiplication method · 12.17 Conflict resolution · 12.18 Chaining · 12.19 Open addressing · 12.20 Problems with open addressing · 12.21 Risks with hashing · 12.22 Recap

What you learn in chapter 12 →

Chapter 13: Graphs: Learning how to model complex relationships in data

13.1 What’s a graph? · 13.2 Definition · 13.3 Friendship graph · 13.4 Directed vs. undirected · 13.5 Cyclic versus acyclic · 13.6 Connected graphs and connected components · 13.7 Trees as graphs · 13.8 Implementing graphs · 13.9 Adjacency list · 13.10 Adjacency matrix · 13.11 Graph search · 13.12 Exploring friends · 13.13 Breadth-first search · 13.14 Depth-first search · 13.15 What’s next · 13.16 Recap

What you learn in chapter 13 →

Concepts explained in this book

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.