The Self-Taught Computer Scientist
Реклама. ООО «ЛитРес», ИНН: 7719571260.
Оглавление
Cory Althoff. The Self-Taught Computer Scientist
Table of Contents
List of Illustrations
Guide
Pages
The Self-Taught Computer Scientist. The beginner’s guide to data structures & algorithms
Introduction
What You Will Learn
Who Is This Book For?
Self-Taught Success Stories
Matt Munson
Tianni Myers
Getting Started
Installing Python
Troubleshooting
Challenges
Sticking with It
I Introduction to Algorithms
1 What Is an Algorithm?
Analyzing Algorithms
Constant Time
Logarithmic Time
Linear Time
Log-Linear Time
Quadratic Time
Cubic Time
Exponential Time
Best-Case vs. Worst-Case Complexity
Space Complexity
Why Is This Important?
Vocabulary
Challenge
2 Recursion
When to Use Recursion
Vocabulary
Challenge
3 Search Algorithms
Linear Search
When to Use a Linear Search
Binary Search
When to Use a Binary Search
Searching for Characters
Vocabulary
Challenge
4 Sorting Algorithms
Bubble Sort
When to Use Bubble Sort
Stable Sort
Unstable Sort
Insertion Sort
When to Use Insertion Sort
Merge Sort
When to Use Merge Sort
Sorting Algorithms in Python
Vocabulary
Challenge
5 String Algorithms
Anagram Detection
Palindrome Detection
Last Digit
Caesar Cipher
Vocabulary
Challenge
6 Math
Binary
Bitwise Operators
FizzBuzz
Greatest Common Factor
Euclid's Algorithm
Primes
Vocabulary
Challenge
7 Self-Taught Inspiration: Margaret Hamilton
II Data Structures
8 What Is a Data Structure?
Vocabulary
Challenge
9 Arrays
Array Performance
Creating an Array
Moving Zeros
Combining Two Lists
Finding the Duplicates in a List
Finding the Intersection of Two Lists
Vocabulary
Challenge
10 Linked Lists
Linked List Performance
Create a Linked List
Search a Linked List
Removing a Node from a Linked List
Reverse a Linked List
Finding a Linked List Cycle
Vocabulary
Challenges
11 Stacks
When to Use Stacks
Creating a Stack
Using Stacks to Reverse Strings
Min Stack
Stacked Parentheses
Vocabulary
Challenges
12 Queues
When to Use Queues
Creating a Queue
Python's Built-In Queue Class
Create a Queue Using Two Stacks
Vocabulary
Challenge
13 Hash Tables
When to Use Hash Tables
Characters in a String
Two Sum
Vocabulary
Challenge
14 Binary Trees
When to Use Trees
Creating a Binary Tree
Breadth-First Tree Traversal
More Tree Traversals
Invert a Binary Tree
Vocabulary
Challenges
15 Binary Heaps
When to Use Heaps
Creating a Heap
Connecting Ropes with Minimal Cost
Vocabulary
Challenge
16 Graphs
When to Use Graphs
Creating a Graph
Dijkstra's Algorithm
Vocabulary
Challenge
17 Self-Taught Inspiration: Elon Musk
18 Next Steps
What’s Next?
Climbing the Freelance Ladder
How to Get an Interview
How to Prepare for a Technical Interview
Additional Resources
Final Thoughts
Index
About the Author
About the Technical Editor
Acknowledgments
WILEY END USER LICENSE AGREEMENT
Отрывок из книги
Cory Althoff
This attempt wasn't my first shot at learning to code: I had tried to learn to program in the past without success. During my freshman year of college, I took a programming class, found it impossible to understand, and quickly dropped it. Unfortunately, most schools teach Java as a first programming language, which is challenging for beginners to understand. Instead of Java, I decided to teach myself Python, one of the easiest languages for beginners to learn. Despite learning an easy-to-understand language, I still almost gave up. I had to piece together information from many different sources, which was frustrating. It also didn't help that I felt like I was on my journey alone. I didn't have a class full of students I could study with and lean on for support.
.....
Suppose you must modify your free book program so that instead of giving a free book to the first customer of the day, you iterate through your list of customers and give them a free book if their name starts with the letter B. This time, however, your list of customers isn't sorted alphabetically. Now you are forced to iterate through your list one by one to find the names that start with B.
free_book = False customers = ["Lexi", "Britney", "Danny", "Bobbi", "Chris"] for customer in customers: if customer[0] == 'B': print(customer)
.....