A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 1



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

1. A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 1
2. About the Pragmatic Bookshelf
3. Table of Contents 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
4. Early Praise for A Common-Sense Guide to Data Struc tures and Algorithms in Python, Volume 1
5. Preface
6. Who Is This Book For?
7. The Python Edition
8. A Note About the Code
9. What’s in This Book?
10. How to Read This Book
11. Online Resources
12. Connecting
13. Acknowledgments
14. Chapter 1: Why Data Structures Matter
15. Data Structures
16. The Array: The Foundational Data Structure
17. Measuring Speed
18. Reading
19. Searching
20. Insertion
21. Deletion
22. Sets: How a Single Rule Can Affect Efficiency
23. Wrapping Up
24. Exercises
25. Chapter 2: Why Algorithms Matter
26. Ordered Arrays
27. Searching an Ordered Array
28. Binary Search
29. Binary Search vs. Linear Search
30. Wrapping Up
31. Exercises
32. Chapter 3: O Yes! Big O Notation
33. Big O: How Many Steps Relative to N Elements?
34. The Soul of Big O
35. An Algorithm of the Third Kind
36. Logarithms
37. O(log N) Explained
38. Practical Examples
39. Wrapping Up
40. Exercises
41. Chapter 4: Speeding Up Your Code with Big O
42. Bubble Sort
43. Bubble Sort in Action
44. The Efficiency of Bubble Sort
45. A Quadratic Problem
46. A Linear Solution
47. Wrapping Up
48. Exercises
49. Chapter 5: Optimizing Code With and Without Big O
50. Selection Sort
51. Selection Sort in Action
52. The Efficiency of Selection Sort
53. Ignoring Constants
54. Big O Categories
55. Wrapping Up
56. Exerci ses
57. Chapter 6: Optimizing for Optimistic Scenarios
58. Insertion Sort
59. Insertion Sort in Action
60. The Efficiency of Insertion Sort
61. The Average Case
62. A Practical Example
63. Wrapping Up
64. Exercises
65. Chapter 7: Big O in Everyday Code
66. Mean Average of Even Numbers
67. Word Builder
68. Array Sample
69. Average Celsius Reading
70. Clothing Labels
71. Count the Ones
72. Palindrome Checker
73. Get All the Products
74. Password Cracker
75. Wrapping Up
76. Exercises
77. Chapter 8: Blazing Fast Lookup with Hash Tables
78. Hash Tables
79. Hashing with Hash Functions
80. Building a Thesaurus for Fun and Profit, but M ainly Profit
81. Hash Table Lookups
82. Dealing with Collisions
83. Making an Efficient Hash Table
84. Hash Tables for Organization
85. Hash Tables for Speed
86. Wrapping Up
87. Exercises
88. Chapter 9: Crafting Elegant Code with Stacks and Queues
89. Stacks
90. Abstract Data Types
91. Stacks in Action
92. The Importance of Constrained Data Structures
93. Queues
94. Queues in Action
95. Wrapping Up
96. Exercises
97. Chapter 10: Recursively Recurse with Recursion
98. Recurse Instead of Loop
99. The Base Case
100. Reading Recursive Code
101. Recursion in the Eyes of the Computer
102. Filesystem Traversal
103. Wrapping Up
104. Exercises
105. Chapter 11: Learning to Write in Recursive
106. Recursive Category: Repeatedly Execute
107. Recursive Category: Calculations
108. Top-Down Recursion: A New Way of Thinking
109. The Staircase Problem
110. Anagram Generation
111. Wrapping Up
112. Exercises
113. Chapter 12: Dynamic Programming
114. Unnecessary Recursive Calls
115. The Little Fix for Big O
116. The Efficiency of Recursion
117. Overlapping Subproblems
118. Dynamic Programming Through Memoization
119. Dynamic Programming Through Going Bottom-Up
120. Wrapping Up
121. Exercises
122. Chapter 13: Recursive Algorithms for Speed
123. Partitioning
124. Quicksort
125. The Efficiency of Quicksort
126. Quicksort in the Worst-Case Scenario
127. Quickselect
128. Sorting as a Key to Other Algorithms
129. Wrapping Up
130. Exercises
131. Chapter 14: Node-Based Data Structures
132. Linked Lists
133. Implementing a Linked List
134. Reading
135. Searching
136. Insertion
137. Deletion
138. Efficiency of Linked List Operations
139. Linked Lists in Action
140. Doubly Linked Lists
141. Queues as Doubly Linked Lists
142. Wrapping Up
143. Exercises
144. Chapter 15: Speeding Up All the Things with Binary Search Trees
145. Trees
146. Binary Search Trees
147. Searching
148. Insertion
149. Deletion
150. Binary Search Trees in Action
151. Binary Search Tree Traversal
152. Wrapping Up
153. Exercises
154. Chapter 16: Keeping Your Priorities Straight with Heaps
155. Priority Queues
156. Heaps
157. Heap Properties
158. Heap Insertion
159. Looking for the Last Node
160. Heap Deletion
161. Heaps vs. Ordered Arrays
162. The Problem of the Last Node…Again
163. Arrays as Heaps
164. Heaps as Priority Queues
165. Wrapping Up
166. Exercises
167. Chapter 17: It Doesn’t Hurt to Trie
168. Tries
169. Storing Words
170. Trie Search
171. The Efficiency of Trie Search
172. Trie Insertion
173. Building Autocomplete
174. Completing Autocomplete
175. Tries with Values: A Better Autocomplete
176. Wrapping Up
177. Exercises
178. Chapter 18: Connecting Everything with Graphs
179. Graphs
180. Directed Graphs
181. Object-Oriented Graph Implementation
182. Graph Search
183. Depth-First Search
184. Breadth-First Search
185. The Efficiency of Graph Search
186. Weighted Graphs
187. Dijkstra’s Algorithm
188. Wrapping Up
189. Exercises
190. Chapter 19: Dealing with Space Constraints
191. Big O of Space Complexity
192. Trade-Offs Between Time and Space
193. The Hidden Cost of Recursion
194. Wrapping Up
195. Exercises
196. Chapter 20: Techniques for Code Optimization
197. Prerequisite: Determine Your Current Big O
198. Start Here: The Best-Imaginable Big O
199. Magical Lookups
200. Recognizing Patterns
201. Greedy Algorithms
202. Change the Data Structure
203. Wrapping Up
204. Parting Thoughts
205. Exercises
206. Appendix 1: Exercise Solutions
207. 1:
208. 2:
209. 3:
210. 4:
211. Chapte r 5
212. 6:
213. 7:
214. 8:
215. 9:
216. 10:
217. 11:
218. 12:
219. 13:
220. 1: 4
221. 15:
222. 16:
223. 17:
224. 18:
225. 19:
226. 20:
227. You May Be Interested In…