About the Author |
|
xix | |
About the Technical Reviewer |
|
xxi | |
Preface |
|
xxiii | |
|
|
1 | (14) |
|
1.1 Structure of the Chapters |
|
|
1 | (2) |
|
|
1 | (1) |
|
|
1 | (1) |
|
|
2 | (1) |
|
1.2 Basic Structure of the PyCharm Project |
|
|
3 | (2) |
|
1.3 Basic Framework for Unit Tests with Pytest |
|
|
5 | (1) |
|
1.4 Note on Programming Style |
|
|
5 | (7) |
|
1.4.1 Thoughts on Source Code Compactness |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
1.4.4 Decorators and Sanity Checks at the Beginning of Functions |
|
|
8 | (1) |
|
1.4.5 Block Comments in Listings |
|
|
8 | (1) |
|
1.4.6 PEP 8 and the Zen of Python |
|
|
9 | (3) |
|
|
12 | (1) |
|
1.5 Note on the Exercises |
|
|
12 | (1) |
|
1.6 Trying Out the Examples and Solutions |
|
|
13 | (1) |
|
1.7 Let's Go: Discovering the Python Challenge |
|
|
13 | (2) |
|
|
15 | (366) |
|
Chapter 2 Mathematical Problems |
|
|
17 | (54) |
|
|
17 | (11) |
|
2.1.1 Short Introduction to Division and Modulo |
|
|
17 | (2) |
|
2.1.2 Short Introduction to Divider |
|
|
19 | (1) |
|
2.1.3 Short Introduction to Prime Numbers |
|
|
20 | (2) |
|
|
22 | (2) |
|
|
24 | (2) |
|
2.1.6 Getting Started with Lambdas |
|
|
26 | (2) |
|
|
28 | (7) |
|
2.2.1 Exercise 1: Basic Arithmetic (*****) |
|
|
28 | (1) |
|
2.2.2 Exercise 2: Number as Text (******) |
|
|
29 | (1) |
|
2.2.3 Exercise 3: Perfect Numbers (******) |
|
|
30 | (1) |
|
2.2.4 Exercise 4: Prime Numbers (******) |
|
|
30 | (1) |
|
2.2.5 Exercise 5: Prime Number Pairs (******) |
|
|
31 | (1) |
|
2.2.6 Exercise 6: Checksum (******) |
|
|
31 | (1) |
|
2.2.7 Exercise 7: Roman Numbers (************) |
|
|
32 | (1) |
|
2.2.8 Exercise 8: Combinatorics (******) |
|
|
33 | (1) |
|
2.2.9 Exercise 9: Armstrong Numbers (******) |
|
|
33 | (1) |
|
2.2.10 Exercise 10: Max Change Calculator (************) |
|
|
34 | (1) |
|
2.2.11 Exercise 11: Related Numbers (******) |
|
|
34 | (1) |
|
2.2.12 Exercise 12: Prime Factorization (*********) |
|
|
35 | (1) |
|
|
35 | (35) |
|
2.3.1 Solution 1: Basic Arithmetic (***) |
|
|
35 | (4) |
|
2.3.2 Solution 2: Number as Text (******) |
|
|
39 | (2) |
|
2.3.3 Solution 3: Perfect Numbers (******) |
|
|
41 | (2) |
|
2.3.4 Solution 4: Prime Numbers (******) |
|
|
43 | (3) |
|
2.3.5 Solution 5: Prime Number Pairs (******) |
|
|
46 | (4) |
|
2.3.6 Solution 6: Checksum (******) |
|
|
50 | (2) |
|
2.3.7 Solution 7: Roman Numbers (************) |
|
|
52 | (5) |
|
2.3.8 Solution 8: Combinatorics (******) |
|
|
57 | (4) |
|
2.3.9 Solution 9: Armstrong Numbers (******) |
|
|
61 | (3) |
|
2.3.10 Solution 10: Max Change Calculator (************) |
|
|
64 | (2) |
|
2.3.11 Solution 11: Related Numbers (******) |
|
|
66 | (1) |
|
2.3.12 Solution 12: Prime Factorization (*********) |
|
|
67 | (3) |
|
2.4 Summary: What You Learned |
|
|
70 | (1) |
|
|
71 | (62) |
|
|
71 | (13) |
|
3.1.1 Mathematical Examples |
|
|
71 | (6) |
|
3.1.2 Algorithmic Examples |
|
|
77 | (5) |
|
3.1.3 Steps When Multiplying the Digits of a Number |
|
|
82 | (1) |
|
3.1.4 Typical Problems: Endless Calls and RecursionError |
|
|
83 | (1) |
|
|
84 | (9) |
|
3.2.1 Exercise 1: Fibonacci (******) |
|
|
84 | (1) |
|
3.2.2 Exercise 2: Process Digits (******) |
|
|
85 | (1) |
|
3.2.3 Exercise 3: GCD (******) |
|
|
86 | (1) |
|
3.2.4 Exercise 4: Reverse String (******) |
|
|
87 | (1) |
|
3.2.5 Exercise 5: List Sum (******) |
|
|
87 | (1) |
|
3.2.6 Exercise 6: List Min (******) |
|
|
88 | (1) |
|
3.2.7 Exercise 7: Conversions (******) |
|
|
88 | (1) |
|
3.2.8 Exercise 8: Exponential Function (******) |
|
|
89 | (1) |
|
3.2.9 Exercise 9: Pascal's Triangle (******) |
|
|
90 | (1) |
|
3.2.10 Exercise 10: Number Palindromes (************) |
|
|
91 | (1) |
|
3.2.11 Exercise 11: Permutations (*********) |
|
|
91 | (1) |
|
3.2.12 Exercise 12: Count Substrings (******) |
|
|
92 | (1) |
|
3.2.13 Exercise 13: Ruler (******) |
|
|
92 | (1) |
|
|
93 | (39) |
|
3.3.1 Solution 1: Fibonacci (******) |
|
|
93 | (2) |
|
3.3.2 Solution 2: Process Digits (******) |
|
|
95 | (3) |
|
3.3.3 Solution 3: GCD (******) |
|
|
98 | (4) |
|
3.3.4 Solution 4: Reverse String (******) |
|
|
102 | (1) |
|
3.3.5 Solution 5: List Sum (******) |
|
|
103 | (2) |
|
3.3.6 Solution 6: List Min (******) |
|
|
105 | (1) |
|
3.3.7 Solution 7: Conversions (******) |
|
|
106 | (4) |
|
3.3.8 Solution 8: Exponential Function (******) |
|
|
110 | (4) |
|
3.3.9 Solution 9: Pascal's Triangle (******) |
|
|
114 | (4) |
|
3.3.10 Solution 10: Number Palindromes (************) |
|
|
118 | (4) |
|
3.3.11 Solution 11: Permutations (*********) |
|
|
122 | (4) |
|
3.3.12 Solution 12: Count Substrings (******) |
|
|
126 | (4) |
|
3.3.13 Solution 13: Ruler (******) |
|
|
130 | (2) |
|
3.4 Summary: What You Learned |
|
|
132 | (1) |
|
|
133 | (64) |
|
|
133 | (8) |
|
4.1.1 Practically Relevant Functions |
|
|
133 | (2) |
|
4.1.2 Example Conversions and Extractions |
|
|
135 | (1) |
|
|
136 | (1) |
|
4.1.4 Slicing---Access to Individual Characters and Substrings |
|
|
137 | (1) |
|
4.1.5 Converting a String into a List of Characters |
|
|
138 | (1) |
|
|
138 | (1) |
|
|
139 | (1) |
|
4.1.8 Character Processing |
|
|
140 | (1) |
|
4.1.9 Example: String Processing |
|
|
140 | (1) |
|
|
141 | (11) |
|
4.2.1 Exercise 1: Number Conversions (******) |
|
|
141 | (1) |
|
4.2.2 Exercise 2: Joiner (***) |
|
|
142 | (1) |
|
4.2.3 Exercise 3: Reverse String (******) |
|
|
142 | (1) |
|
4.2.4 Exercise 4: Palindrome (********) |
|
|
143 | (1) |
|
4.2.5 Exercise 5: No Duplicate Chars (*********) |
|
|
144 | (1) |
|
4.2.6 Exercise 6: Remove Duplicate Letters (*********) |
|
|
144 | (1) |
|
4.2.7 Exercise 7: Capitalize (******) |
|
|
145 | (1) |
|
4.2.8 Exercise 8: Rotation (******) |
|
|
146 | (1) |
|
4.2.9 Exercise 9: Well Formed Braces (******) |
|
|
146 | (1) |
|
4.2.10 Exercise 10: Anagram (******) |
|
|
147 | (1) |
|
4.2.11 Exercise 11: Morse Code (******) |
|
|
147 | (1) |
|
4.2.12 Exercise 12: Pattern Checker (*********) |
|
|
148 | (1) |
|
4.2.13 Exercise 13: Tennis Score (*********) |
|
|
148 | (1) |
|
4.2.14 Exercise 14: Version Numbers (******) |
|
|
149 | (1) |
|
4.2.15 Exercise 15: Conversion str_to_number (******) |
|
|
150 | (1) |
|
4.2.16 Exercise 16: Print Tower (*********) |
|
|
151 | (1) |
|
4.2.17 Exercise 17: Filled Frame (******) |
|
|
151 | (1) |
|
4.2.18 Exercise 18: Guessing Vowels (******) |
|
|
151 | (1) |
|
|
152 | (44) |
|
4.3.1 Solution 1: Number Conversions (******) |
|
|
152 | (4) |
|
4.3.2 Solution 2: Joiner (***) |
|
|
156 | (1) |
|
4.3.3 Solution 3: Reverse String (******) |
|
|
157 | (3) |
|
4.3.4 Solution 4: Palindrome (*********) |
|
|
160 | (4) |
|
4.3.5 Solution 5: No Duplicate Chars (*********) |
|
|
164 | (2) |
|
4.3.6 Solution 6: Remove Duplicate Letters (*********) |
|
|
166 | (1) |
|
4.3.7 Solution 7: Capitalize (******) |
|
|
167 | (5) |
|
4.3.8 Solution 8: Rotation (******) |
|
|
172 | (1) |
|
4.3.9 Solution 9: Well Formed Braces (******) |
|
|
173 | (2) |
|
4.3.10 Solution 10: Anagram (******) |
|
|
175 | (2) |
|
4.3.11 Solution 11: Morse Code (******) |
|
|
177 | (2) |
|
4.3.12 Solution 12: Pattern Checker (*********) |
|
|
179 | (3) |
|
4.3.13 Solution 13: Tennis Score (*********) |
|
|
182 | (3) |
|
4.3.14 Solution 14: Version Numbers (******) |
|
|
185 | (2) |
|
4.3.15 Solution 15: Conversion str_to_number (******) |
|
|
187 | (4) |
|
4.3.16 Solution 16: Print Tower (*********) |
|
|
191 | (2) |
|
4.3.17 Solution 17: Filled Frame (******) |
|
|
193 | (1) |
|
4.3.18 Solution 18: Guessing Vowels (******) |
|
|
194 | (2) |
|
4.4 Summary: What You Learned |
|
|
196 | (1) |
|
Chapter 5 Basic Data Structures: Lists, Sets, and Dictionaries |
|
|
197 | (70) |
|
|
197 | (17) |
|
5.1.1 Sequential Data Types |
|
|
197 | (2) |
|
|
199 | (6) |
|
|
205 | (1) |
|
5.1.4 Key-Value Mappings (Dictionaries) |
|
|
206 | (3) |
|
5.1.5 The Stack as a UFO Data Structure |
|
|
209 | (1) |
|
5.1.6 The Queue as a FIFO Data Structure |
|
|
210 | (4) |
|
|
214 | (8) |
|
5.2.1 Exercise 1: Common Elements (******) |
|
|
214 | (1) |
|
5.2.2 Exercise 2: Your Own Stack (******) |
|
|
215 | (1) |
|
5.2.3 Exercise 3: List Reverse (******) |
|
|
215 | (1) |
|
5.2.4 Exercise 4: Remove Duplicates (******) |
|
|
216 | (1) |
|
5.2.5 Exercise 5: Maximum Profit (*********) |
|
|
216 | (1) |
|
5.2.6 Exercise 6: Longest Sequence (*********) |
|
|
217 | (1) |
|
5.2.7 Exercise 7: Well-Formed Braces (******) |
|
|
217 | (1) |
|
5.2.8 Exercise 8: Pascal's Triangle (*********) |
|
|
218 | (1) |
|
5.2.9 Exercise 9: Check Magic Triangle (*********) |
|
|
219 | (1) |
|
5.2.10 Exercise 10: Most Frequent Elements (******) |
|
|
219 | (1) |
|
5.2.11 Exercise 11: Addition of Digits (*********) |
|
|
220 | (1) |
|
5.2.12 Exercise 12: List Merge (******) |
|
|
220 | (1) |
|
5.2.13 Exercise 13: Excel Magic Select (******) |
|
|
221 | (1) |
|
5.2.14 Exercise 14: Stack-Based Queue (******) |
|
|
221 | (1) |
|
|
222 | (44) |
|
5.3.1 Solution 1: Common Elements (******) |
|
|
222 | (3) |
|
5.3.2 Solution 2: Your Own Stack (******) |
|
|
225 | (2) |
|
5.3.3 Solution 3: List Reverse (******) |
|
|
227 | (4) |
|
5.3.4 Solution 4: Remove Duplicates (******) |
|
|
231 | (2) |
|
5.3.5 Solution 5: Maximum Profit (*********) |
|
|
233 | (2) |
|
5.3.6 Solution 6: Longest Sequence (?(*********) |
|
|
235 | (4) |
|
5.3.7 Solution 7: Well-Formed Braces (******) |
|
|
239 | (5) |
|
5.3.8 Solution 8: Pascal's Triangle (*********) |
|
|
244 | (2) |
|
5.3.9 Solution 9: Check Magic Triangle (*********) |
|
|
246 | (4) |
|
5.3.10 Solution 10: Most Frequent Elements (******) |
|
|
250 | (2) |
|
5.3.11 Solution 11: Addition of Digits (*********) |
|
|
252 | (5) |
|
5.3.12 Solution 12: List Merge (******) |
|
|
257 | (4) |
|
5.3.13 Solution 13: Excel Magic Select (******) |
|
|
261 | (3) |
|
5.3.14 Solution 14: Stack-Based Queue (******) |
|
|
264 | (2) |
|
5.4 Summary: What You Learned |
|
|
266 | (1) |
|
|
267 | (114) |
|
|
267 | (29) |
|
6.1.1 One-Dimensional Arrays |
|
|
268 | (10) |
|
6.1.2 Multidimensional Arrays |
|
|
278 | (8) |
|
|
286 | (1) |
|
|
287 | (2) |
|
6.1.5 Recapitulation: NumPy |
|
|
289 | (7) |
|
|
296 | (14) |
|
6.2.1 Exercise 1: Even Before Odd Numbers (******) |
|
|
296 | (1) |
|
6.2.2 Exercise 2: Flip (******) |
|
|
297 | (1) |
|
6.2.3 Exercise 3: Palindrome (******) |
|
|
297 | (1) |
|
6.2.4 Exercise 4: Inplace Rotate (*********) |
|
|
298 | (1) |
|
6.2.5 Exercise 5: Jewels Board Init (*********) |
|
|
298 | (2) |
|
6.2.6 Exercise 6: Jewels Board Erase Diamonds (************) |
|
|
300 | (2) |
|
6.2.7 Exercise 7: Spiral Traversal (************) |
|
|
302 | (1) |
|
6.2.8 Exercise 8: Add One to an Array as a Number (******) |
|
|
303 | (1) |
|
6.2.9 Exercise 9: Sudoku Checker (*********) |
|
|
303 | (1) |
|
6.2.10 Exercise 10: Flood Fill (******) |
|
|
304 | (1) |
|
6.2.11 Exercise 11: Array Min and Max (******) |
|
|
305 | (1) |
|
6.2.12 Exercise 12: Array Split (*********) |
|
|
306 | (2) |
|
6.2.13 Exercise 13: Minesweeper Board (*********) |
|
|
308 | (2) |
|
|
310 | (71) |
|
6.3.1 Solution 1: Even Before Odd Numbers (******) |
|
|
310 | (4) |
|
6.3.2 Solution 2: Flip (******) |
|
|
314 | (5) |
|
6.3.3 Solution 3: Palindrome (******) |
|
|
319 | (2) |
|
6.3.4 Solution 4: Inplace Rotate (*********) |
|
|
321 | (5) |
|
6.3.5 Solution 5: Jewels Board Init (*********) |
|
|
326 | (8) |
|
6.3.6 Solution 6: Jewels Board Erase Diamonds (************) |
|
|
334 | (12) |
|
6.3.7 Solution 7: Spiral Traversal (************) |
|
|
346 | (5) |
|
6.3.8 Solution 8: Add One to an Array as a Number (******) |
|
|
351 | (2) |
|
6.3.9 Solution 9: Sudoku Checker (*********) |
|
|
353 | (6) |
|
6.3.10 Solution 10: Flood Fill (******) |
|
|
359 | (5) |
|
6.3.11 Solution 11: Array Min and Max (******) |
|
|
364 | (3) |
|
6.3.12 Solution 12: Array Split (*********) |
|
|
367 | (5) |
|
6.3.13 Solution 13: Minesweeper Board (*********) |
|
|
372 | (9) |
|
Part II More Advanced and Tricky Topics |
|
|
381 | (232) |
|
Chapter 7 Advanced Recursion |
|
|
383 | (76) |
|
|
383 | (10) |
|
7.1.1 Memoization for Fibonacci Numbers |
|
|
383 | (3) |
|
7.1.2 Memoization for Pascal's Triangle |
|
|
386 | (2) |
|
7.1.3 Memoization with Python On-Board Tools |
|
|
388 | (5) |
|
|
393 | (5) |
|
7.2.1 The n-Queens Problem |
|
|
393 | (5) |
|
|
398 | (8) |
|
7.3.1 Exercise 1: Towers of Hanoi (*********) |
|
|
398 | (1) |
|
7.3.2 Exercise 2: Edit Distance (************) |
|
|
399 | (1) |
|
7.3.3 Exercise 3: Longest Common Subsequence (*********) |
|
|
400 | (1) |
|
7.3.4 Exercise 4: Way Out of a Labyrinth (*********) |
|
|
401 | (1) |
|
7.3.5 Exercise 5: Sudoku Solver (************) |
|
|
402 | (1) |
|
7.3.6 Exercise 6: Math Operator Checker (************) |
|
|
403 | (1) |
|
7.3.7 Exercise 7: Water Jug Problem (*********) |
|
|
404 | (1) |
|
7.3.8 Exercise 8: All Palindrome Substrings (************) |
|
|
405 | (1) |
|
7.3.9 Exercise 9: The n-Queens Problem (*********) |
|
|
405 | (1) |
|
|
406 | (51) |
|
7.4.1 Solution 1: Towers of Hanoi (*********) |
|
|
406 | (7) |
|
7.4.2 Solution 2: Edit Distance (************) |
|
|
413 | (5) |
|
7.4.3 Solution 3: Longest Common Subsequence (*********) |
|
|
418 | (4) |
|
7.4.4 Solution 4: Way Out of a Labyrinth (*********) |
|
|
422 | (4) |
|
7.4.5 Solution 5: Sudoku Solver (************) |
|
|
426 | (9) |
|
7.4.6 Solution 6: Math Operator Checker (************) |
|
|
435 | (4) |
|
7.4.7 Solution 7: Water Jug Problem (*********) |
|
|
439 | (4) |
|
7.4.8 Exercise 8: All Palindrome Substrings (************) |
|
|
443 | (6) |
|
7.4.9 Solution 9: The n-Queens Problem (*********) |
|
|
449 | (8) |
|
7.5 Summary: What You Learned |
|
|
457 | (2) |
|
|
459 | (98) |
|
|
459 | (12) |
|
8.1.1 Structure, Terminology, and Examples of Use |
|
|
460 | (1) |
|
|
460 | (1) |
|
8.1.3 Binary Trees with Order: Binary Search Trees |
|
|
461 | (3) |
|
|
464 | (2) |
|
8.1.5 Balanced Trees and Other Properties |
|
|
466 | (3) |
|
8.1.6 Trees for the Examples and Exercises |
|
|
469 | (2) |
|
|
471 | (14) |
|
8.2.1 Exercise 1: Tree Traversal (******) |
|
|
471 | (1) |
|
8.2.2 Exercise 2: Inorder, Preorder, and Postorder Iterative (************) |
|
|
472 | (1) |
|
8.2.3 Exercise 3: Tree Height (******) |
|
|
473 | (1) |
|
8.2.4 Exercise 4: Lowest Common Ancestor (*********) |
|
|
473 | (1) |
|
8.2.5 Exercise 5: Breadth-First (*********) |
|
|
474 | (1) |
|
8.2.6 Exercise 6: Level Sum (************) |
|
|
474 | (1) |
|
8.2.7 Exercise 7: Tree Rotate (*********) |
|
|
475 | (1) |
|
8.2.8 Exercise 8: Reconstruction (*********) |
|
|
476 | (1) |
|
8.2.9 Exercise 9: Math Evaluation (******) |
|
|
477 | (1) |
|
8.2.10 Exercise 10: Symmetry (******) |
|
|
477 | (2) |
|
8.2.11 Exercise 11: Check Binary Search Tree (******) |
|
|
479 | (1) |
|
8.2.12 Exercise 12: Completeness (***************) |
|
|
479 | (2) |
|
8.2.13 Exercise 13: Tree Printer (***************) |
|
|
481 | (4) |
|
|
485 | (69) |
|
8.3.1 Solution 1: Tree Traversal (******) |
|
|
485 | (4) |
|
8.3.2 Solution 2: Inorder, Preorder, and Postorder Iterative (************) |
|
|
489 | (8) |
|
8.3.3 Solution 3: Tree Height (******) |
|
|
497 | (2) |
|
8.3.4 Solution 4: Lowest Common Ancestor (*********) |
|
|
499 | (3) |
|
8.3.5 Solution 5: Breadth-First (*********) |
|
|
502 | (3) |
|
8.3.6 Solution 6: Level Sum (************) |
|
|
505 | (4) |
|
8.3.7 Solution 7: Tree Rotate (*********) |
|
|
509 | (4) |
|
8.3.8 Solution 8: Reconstruction (*********)) |
|
|
513 | (6) |
|
8.3.9 Solution 9: Math Evaluation (******) |
|
|
519 | (3) |
|
8.3.10 Solution 10: Symmetry (******) |
|
|
522 | (5) |
|
8.3.11 Solution 11: Check Binary Search Tree (******) |
|
|
527 | (3) |
|
8.3.12 Solution 12: Completeness ***************) |
|
|
530 | (12) |
|
8.3.13 Solution 13: Tree Printer (***************) |
|
|
542 | (12) |
|
8.4 Summary: What You Learned |
|
|
554 | (3) |
|
Chapter 9 Searching and Sorting |
|
|
557 | (44) |
|
|
557 | (3) |
|
9.1.1 Search with in(), index(), and count() |
|
|
557 | (2) |
|
9.1.2 Search with rindex() and rfind() |
|
|
559 | (1) |
|
|
559 | (1) |
|
|
560 | (12) |
|
|
560 | (3) |
|
|
563 | (3) |
|
|
566 | (2) |
|
|
568 | (2) |
|
|
570 | (1) |
|
|
571 | (1) |
|
|
572 | (5) |
|
9.3.1 Exercise 1: Contains All (******) |
|
|
572 | (1) |
|
9.3.2 Exercise 2: Partitioning (************) |
|
|
573 | (1) |
|
9.3.3 Exercise 3: Binary Search (******) |
|
|
573 | (1) |
|
9.3.4 Exercise 4: Insertion Sort (******) |
|
|
574 | (1) |
|
9.3.5 Exercise 5: Selection Sort (******) |
|
|
574 | (1) |
|
9.3.6 Exercise 6: Quick Sort (*********) |
|
|
575 | (1) |
|
9.3.7 Exercise 7: Bucket Sort (******) |
|
|
576 | (1) |
|
9.3.8 Exercise 8: Search in Rotated Data (************) |
|
|
576 | (1) |
|
|
577 | (22) |
|
9.4.1 Solution 1: Contains All (******) |
|
|
577 | (2) |
|
9.4.2 Solution 2: Partitioning (************) |
|
|
579 | (2) |
|
9.4.3 Solution 3: Binary Search (******) |
|
|
581 | (4) |
|
9.4.4 Solution 4: Insertion Sort (******) |
|
|
585 | (1) |
|
9.4.5 Solution 5: Selection Sort (******) |
|
|
586 | (2) |
|
9.4.6 Solution 6: Quick Sort (*********) |
|
|
588 | (2) |
|
9.4.7 Solution 7: Bucket Sort (******) |
|
|
590 | (2) |
|
9.4.8 Solution 8: Search in Rotated Data (************) |
|
|
592 | (7) |
|
9.5 Summary: What You Learned |
|
|
599 | (2) |
|
Chapter 10 Conclusion and Supplementary Literature |
|
|
601 | (12) |
|
|
601 | (4) |
|
10.1.1 Lessons Learned Per Chapter |
|
|
601 | (2) |
|
|
603 | (2) |
|
|
605 | (4) |
|
10.2.1 Gold Bags-Detect the Fake |
|
|
605 | (1) |
|
10.2.2 Horse Race-Determine Fastest Three Horses |
|
|
606 | (3) |
|
10.3 Supplementary Literature |
|
|
609 | (4) |
|
10.3.1 Introduction to Algorithms and Data Structures |
|
|
610 | (1) |
|
|
610 | (1) |
|
10.3.3 Specializing in Interview Questions |
|
|
611 | (1) |
|
10.3.4 Supplements for Job Interviews at Top Companies |
|
|
612 | (1) |
|
|
613 | (2) |
|
Appendix A Short Introduction to pytest |
|
|
615 | (8) |
|
A.1 Writing and Executing Tests |
|
|
615 | (7) |
|
|
615 | (1) |
|
|
616 | (1) |
|
|
617 | (2) |
|
A.1.4 Handling Expected Exceptions |
|
|
619 | (1) |
|
A.1.5 Parameterized Tests with pytest |
|
|
620 | (2) |
|
A.2 Further Reading on pytest |
|
|
622 | (1) |
|
Appendix B Short Introduction to Decorators |
|
|
623 | (6) |
|
B.1 Argument Checks by Decorator |
|
|
623 | (1) |
|
B.2 Syntactic Sugar for Decorators |
|
|
624 | (1) |
|
B.3 Checking Multiple Parameters |
|
|
625 | (1) |
|
B.4 Logging Function Calls and Parameter Passing |
|
|
626 | (2) |
|
B.5 Improvement with wraps from the functools Module |
|
|
628 | (1) |
|
Appendix C Quick Start O-Notation |
|
|
629 | (6) |
|
C.1 Estimations with O-Notation |
|
|
629 | (6) |
|
|
630 | (2) |
|
C.1.2 Complexity and Program Running Time |
|
|
632 | (3) |
|
Appendix D Short Introduction to Python 3.10 |
|
|
635 | (10) |
|
|
635 | (2) |
|
D.1.1 Assignment Error Messages |
|
|
635 | (1) |
|
D.1.2 Error Messages for Incomplete Strings |
|
|
636 | (1) |
|
D.2 Case Distinctions with match |
|
|
637 | (3) |
|
|
637 | (3) |
|
|
640 | (5) |
|
D.3.1 Improvements in Context Managers |
|
|
640 | (1) |
|
D.3.2 Performance Improvements |
|
|
641 | (1) |
|
|
641 | (1) |
|
D.3.4 Typechecking Improvements |
|
|
642 | (3) |
Bibliography |
|
645 | (2) |
Index |
|
647 | |