A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 2 (for True Epub)



Рейтинг:
Добавить в избранные:
Автор:
Страниц: 164

1. A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 2
2. Level Up Your Core Programming Skills
3. by Jay Wengrow
4. About the Pragmatic Bookshelf
5. Table of Contents 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
6. Early Praise for A Common-Sense Guide to Data Struc tures and Algorithms in Python, Volume 2
7. Acknowledgments
8. Preface
9. Who Is This Book For?
10. What’s in This Book?
11. How to Read This Book
12. A Note About the Code
13. Online Resources
14. Connecting
15. Chapter 1: Getting Things in Order with Mergesort
16. Merging Arrays
17. Merging in Action
18. The Efficiency of Merging
19. Mergesort
20. Mergesort in Action
21. The Efficiency of Mergesort
22. Comparing Mergesort and Quicksort: Lessons Learned
23. Wrapping Up
24. Exercises
25. Chapter 2: Benchmarking Code
26. Benchmarking
27. Using the timeit Module
28. Benchmarking Gotchas
29. Benchmarking Sorting Al gorithms
30. Mergesort vs. Insertion Sort
31. Mergesort vs. Quicksort
32. Using Python’s Built-In Sorting Algorithm
33. Quicksorting a Sorted Array
34. Wrapping Up
35. Exercises
36. Chapter 3: How Random Is That?
37. Randomized Quicksort
38. Randomized Algorithms
39. Generating Random Numbers
40. TRNGs vs. PRNGs
41. The Fisher-Yates Shuffle
42. The Fisher-Yates Shuffle in Action
43. The Efficiency of the Fisher-Yates Shuffle
44. Shuffling the Wrong Way
45. Binary Search Tree Randomization
46. Randomization for Distribution
47. Load Balancing
48. Wrapping Up
49. Exercises
50. Chapter 4: Cache Is King
51. Caching
52. Eviction Policies
53. LRU Cache
54. The LRU Cache Data Structure
55. Fixing the LRU Worst-Case Scenario with Random ization
56. The Memory Hierarchy
57. Writing Cache-Friendly Code
58. Spatial Locality
59. Wrapping Up
60. Exercises
61. Chapter 5: The Great Balancing Act of Red-Black Trees
62. Online Algorithms and Self-Balancing Trees
63. Red-Black Trees
64. The Red-Black Rules
65. Red-Black Tree Insertion
66. The Efficiency of Red-Black Trees
67. Red-Black Tree Deletion
68. Wrapping Up
69. Exercises
70. Chapter 6: Randomized Treaps: Haphazardly Achieving Equilibrium
71. Treaps
72. Treap Insertion
73. Self-Balancing Treaps in Action
74. The Power of Random Priorities
75. Treap Deletion
76. Wrapping Up
77. Exercises
78. Chapter 7: To B-Tree or Not to B-Tree: External-Memory Algorithms
79. External Memory
80. Count I/Os, Not Steps
81. External Binary Search
82. Optimizing External-Memory Algorithms
83. Binary Search Trees in External Memory
84. B-Trees
85. Implementing B-Trees
86. B-Tree Insertion
87. B-Tree Deletion
88. The Balance of B-Trees
89. B-Trees as Database Indexes
90. Wrapping Up
91. Exercises
92. Chapter 8: Wrangling Big Data with M/B-Way Mergesort
93. External-Memory Sorting
94. A First Attempt: Two-Way External Mergesort
95. M = Main Memory Size
96. A Second Attempt at External Mergesort
97. Merging K Sorted Lists
98. M/B-Way Mergesort
99. Wrapping Up
100. Exercises
101. Chapter 9: Counting on Monte Carlo Algorithms
102. Monte Carlo Algorithms
103. Monte Carlo Algorithms vs. Las Vegas Algorith ms
104. Obtaining Averages Through Random Sampling
105. Primality Testing
106. Monte Carlo Primality Testing
107. Fermat’s Little Theorem
108. Fermat’s Primality Test
109. Wrapping Up
110. Exercises
111. Chapter 10: Designing Great Hash Tables with Randomization
112. Hash Functions: A Quick Review
113. Scalable Hash Functions
114. The Division Method
115. Randomized Hashing
116. Wrapping Up
117. Exercises
118. Chapter 11: Keeping Your Text Search Sharp with a Little Rabin-Karp
119. Substring Search
120. Brute-Force Substring Search
121. The Sliding Window Technique
122. Rabin-Karp Substring Search
123. Covering All Our Bases
124. Perfecting Rabin-Karp with Base 26
125. Handling Long Needles
126. Monte-Carlo Rabin-Karp
127. Converting Monte Carlo to Las Vegas
128. Wrapping Up
129. Exercises
130. Chapter 12: Saving Space: Every Bit Helps
131. Sets
132. Boolean Arrays
133. Bit Vectors
134. Bit Manipulation
135. Bit Masks: The Key to Zeroing in on a Bit
136. Benchmarking Space
137. The Space Complexity of Sets
138. Classic Set Operations
139. Wrapping Up
140. Exercises
141. Chapter 13: Cultivating Efficiency with Bloom Filters
142. Finding Duplicates Revisited
143. Bloom Filters
144. Use Multiple Hash Functions
145. Using Bloom Filters for Detecting Duplicates
146. Bloom Filters in the Wild
147. Wrapping Up
148. Parting Thoughts
149. Exercises
150. Appendix 1: Solutions
151. 1:
152. 2:
153. 3:
154. 4:
155. 5:
156. 6:
157. 7:
158. 8:
159. 9:
160. 10:
161. 11:
162. 12:
163. 13:
164. You May Be Interested In…