Muutke küpsiste eelistusi

Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples [Pehme köide]

  • Formaat: Paperback / softback, 304 pages, kõrgus x laius: 234x177 mm
  • Ilmumisaeg: 08-Nov-2022
  • Kirjastus: No Starch Press,US
  • ISBN-10: 1718502605
  • ISBN-13: 9781718502604
Teised raamatud teemal:
  • Formaat: Paperback / softback, 304 pages, kõrgus x laius: 234x177 mm
  • Ilmumisaeg: 08-Nov-2022
  • Kirjastus: No Starch Press,US
  • ISBN-10: 1718502605
  • ISBN-13: 9781718502604
Teised raamatud teemal:
"This accessible and entertaining book provides an in-depth introduction to computational thinking through the lens of data structures, a critical component in any programming endeavor. It will give you a strong background in implementing and working with more than 15 key data structures, from arrays, stacks, and queues to caches, bloom filters, skip lists, and graphs"--

Learn how and when to use the right data structures in any situation, strengthening your computational thinking, problem-solving, and programming skills in the process.

This accessible and entertaining book provides an in-depth introduction to computational thinking through the lens of data structures — a critical component in any programming endeavor. You’ll learn how to work with more than 15 key data structures, from stacks, queues, and caches to bloom filters, skip lists, and graphs. You’ll also master linked lists by virtually standing in line at a cafe, hash tables by cataloging the history of the summer Olympics, and Quadtrees by neatly organizing your kitchen cabinets, all while becoming familiar with basic computer science concepts, like recursion and running time analysis.

Arvustused

"The perfect book for novice programmers as well as developers who want to improve their knowledge of key software concepts." Ben Dickson, TechTalks

"Clear and fun to someone learning the topics for the first time. . . . overall a great read." Jeanne Boyarsky, CodeRanch

"A good book to read from beginning to end . . . a nice quick reference for reading about data structures, the complexity of each one, and for what is useful or not!" Eduardo Blázquez, @Farenain, COSEC Lab at Charles III University of Madrid

"Good overview of data structures, intuitive with good visualizations." Lucille E Nguyen, Computational Social Scientist

"A fun intro to the topic for self-taught programmers and data scientists." Crow Intelligence

Acknowledgments xvii
Introduction xix
Intended Audience xx
Language-Agnostic xxi
On Analogies and Brewing Coffee xxi
How to Use This Book xxii
1 Information In Memory
1(12)
Variables
2(1)
Composite Data Structures
3(2)
Arrays
5(5)
Insertion Sort
8(2)
Strings
10(1)
Why This Matters
11(2)
2 Binary Search
13(12)
The Problem
14(1)
Linear Scan
14(2)
Binary Search Algorithm
16(4)
Absent Values
18(2)
Implementing Binary Search
20(1)
Adapting Binary Search
20(2)
Runtime
22(1)
Why This Matters
23(2)
3 Dynamic Data Structures
25(18)
The Limitations of Arrays
26(3)
Pointers and References
29(1)
Linked Lists
30(3)
Operations on Linked Lists
33(6)
Inserting into a Linked List
34(3)
Deleting from a Linked List
37(2)
Doubly Linked Lists
39(1)
Arrays and Linked Lists of Items
39(1)
Why This Matters
40(3)
4 Stacks And Queues
43(12)
Stacks
44(3)
Stacks as Arrays
44(2)
Stacks as Linked Lists
46(1)
Queues
47(3)
Queues as Arrays
47(2)
Queues as Linked Lists
49(1)
The Importance of Order
50(4)
Depth-First Search
51(1)
Breadth-First Search
52(2)
Why This Matters
54(1)
5 Binary Search Trees
55(1)
Binary Search Tree Structure
56(2)
Searching Binary Search Trees
58(1)
Iterative and Recursive Searches
59(3)
Searching Trees vs. Searching Sorted Arrays
62(1)
Modifying Binary Search Trees
63(1)
Adding Nodes
64(1)
Removing Nodes
65(6)
The Danger of Unbalanced Trees
71(1)
Bulk Construction of Binary Search Trees
72(1)
Why This Matters
73(2)
6 Tries And Adapting Data Structures
75(18)
Binary Search Trees of Strings
76(2)
Strings in Trees
70(7)
The Cost of String Comparison
77(1)
Tries
78(12)
Searching Tries
81(4)
Adding and Removing Nodes
85(5)
Why This Matters
90(3)
7 Priority Queues And Heaps
93(20)
Priority Queues
94(2)
Max Heaps
96(9)
Adding Elements to a Heap
98(3)
Removing the Highest-Priority Elements from Heaps
101(3)
Storing Auxiliary Information
104(1)
Updating Priorities
105(1)
Min Heaps
106(2)
Heapsort
108(3)
Why This Matters
111(2)
8 Grids
113(1)
Introducing Nearest-Neighbor Search
114(5)
Nearest-Neighbor Search with Linear Scan
114(5)
Searching Spatial Data
119(1)
Grids
119(5)
Grid Structure
120(2)
Building Grids and Inserting Points
122(1)
Deleting Points
122(2)
Searches Over Grids
124(10)
Pruning Bins
124(3)
Linear Scan Over Bins
127(1)
Ideal Expanding Search over Bins
128(2)
Simplified Expanding Search
130(4)
The Importance of Grid Size
134(1)
Beyond Two Dimensions
135(3)
Beyond Spatial Data
138(1)
Why This Matters
138(1)
9 Spatial Trees
138(1)
Quadtrees
140(3)
Building Uniform Quadtrees
143(2)
Adding Points
145(2)
Removing Points
147(3)
Searching Uniform QuadTrees
150(7)
Nearest-Neighbor Search Code
157(1)
K-d Trees
158(1)
K-d Tree Structure
159(4)
Tighter Spatial Bounds
163(2)
Building k-d Trees
165(2)
K-d Tree Operations
168(2)
Why This Matters
170(1)
10 Hash Tables
171(1)
Storage and Search with Keys
172(2)
Hash Tables
174(2)
Collisions
176(2)
Chaining
178(1)
Linear Probing
179(4)
Hash Functions
183(2)
Handling Non-numeric Keys
183(1)
An Example Use Case
184(1)
Why This Matters
185(2)
11 Caches
187(12)
Introducing Caches
188(2)
LRU Eviction and Caches
190(5)
Building an LRU Cache
190(3)
Updating an Element's Recency
193(2)
Other Eviction Strategies
195(1)
Why This Matters
196(3)
12 B-TREES
199(26)
B-tree Structure
200(3)
Searching B-trees
203(2)
Adding Keys
205(7)
The Addition Algorithm
205(5)
Examples of Adding Keys
210(2)
Removing Keys
212(10)
Fixing Under-full Nodes
212(5)
Finding the Minimum Value Key
217(1)
The Removal Algorithm
217(2)
Examples of Removing Keys
219(3)
Why This Matters
222(3)
13 Bloom Filters
225(10)
Introducing Bloom Filters
226(6)
Hash Tables of Indicators
227(1)
The Bloom Filter
228(3)
Bloom Filter Code
231(1)
Tuning Bloom Filter Parameters
232(1)
Bloom Filters vs. Hash Tables
233(1)
Why This Matters
234(1)
14 Skip Lists
235(12)
Randomized vs. Deterministic Structures
236(1)
Introducing Skip Lists
237(7)
Searching Skip Lists
239(2)
Adding Nodes
241(2)
Deleting Nodes
243(1)
Runtimes
244(1)
Why This Matters
245(2)
15 Graphs
247(18)
Introducing Graphs
248(4)
Representing Graphs
249(2)
Searching Graphs
251(1)
Finding Shortest Paths with Dijkstra's Algorithm
252(4)
Finding Minimum Spanning Trees with Prim's Algorithm
256(4)
Topological Sort with Kahn's Algorithm
260(3)
Why This Matters
263(2)
CONCLUSION
265(6)
What Is the Impact of the Data's Structure?
266(1)
Do We Need Dynamic Data Structures?
266(1)
What Is the Amortized Cost?
267(1)
How Can We Adapt Data Structures to a Specific Problem?
267(1)
What Are the Memory vs. Runtime Tradeoffs?
268(1)
How Can We Tune Our Data Structure?
268(1)
How Does Randomization Impact Expected Behavior?
269(1)
Why This Matters
269(2)
Index 271
Jeremy Kubica is an engineer director specializing in artificial intelligence and machine learning. He received a Ph.D. in Robotics from Carnegie Mellon University and a BS in Computer Science from Cornell University. He spent his graduate school years creating algorithms to detect killer asteroids (actually stopping them was, of course, left as future work). He is the author of multiple books designed to introduce people to computer science, including Computational Fairy Tales and The CS Detective, as well as the Computational Fairy Tales Blog.