Classic Computer Science Problems in Python

Classic Computer Science Problems in Python

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

Classic Computer Science Problems in Python deepens your knowledge of problem solving techniques from the realm of computer science by challenging you with time-tested scenarios, exercises, and algorithms. As you work through examples in search, clustering, graphs, and more, you'll remember important things you've forgotten and discover classic solutions to your "new" problems!

About the Technology
Computer science problems that seem new or unique are often rooted in classic algorithms, coding techniques, and engineering principles. And classic approaches are still the best way to solve them! Understanding these techniques in Python expands your potential for success in web development, data munging, machine learning, and more.

About the Book
Classic Computer Science Problems in Python sharpens your CS problem-solving skills with time-tested scenarios, exercises, and algorithms, using Python. You'll tackle dozens of coding challenges, ranging from simple tasks like binary search algorithms to clustering data using k-means. You'll especially enjoy the feeling of satisfaction as you crack problems that connect computer science to the real-world concerns of apps, data, performance, and even nailing your next job interview!

About the Reader
For intermediate Python programmers.

About the Author
David Kopec is an assistant professor of Computer Science and Innovation at Champlain College in Burlington, Vermont. He is the author of Dart for Absolute Beginners (Apress, 2014) and Classic Computer Science Problems in Swift (Manning, 2018).

We interviewed David as a part of our Six Questions series. Check it out here.

Quotes
Whether you're a novice or a seasoned professional, there's an Aha! moment in this book for everyone.
- James Watson, Adaptive

A fun way to get hands-on experience with classical computer science problems in modern Python.
- Jens Christian Bredahl Madsen, IT Relation

Highly recommended to everyone who is interested in deepening their understanding, not only of the Python language, but also of practical computer science.
- Daniel Kenney-Jung, MD, University of Minnesota

Classic problems presented in a wonderfully entertaining way with a language that always seems to have something new to offer.
- Sam Zaydel, RackTop Systems

Show and hide more Table of contents Product information

Table of contents

  1. Copyright
    1. Dedication
    1. Trademarks
    2. Book forum
    1. Why Python?
    2. What is a classic computer science problem?
    3. What kinds of problems are in this book?
    4. Who is this book for?
    5. Python versioning, source code repository, and type hints
    6. No graphics, no UI code, just the standard library
    7. Part of a series
    1. 1.1. The Fibonacci sequence
    2. 1.2. Trivial compression
    3. 1.3. Unbreakable encryption
    4. 1.4. Calculating pi
    5. 1.5. The Towers of Hanoi
    6. 1.6. Real-world applications
    7. 1.7. Exercises
    1. 2.1. DNA search
    2. 2.2. Maze solving
    3. 2.3. Missionaries and cannibals
    4. 2.4. Real-world applications
    5. 2.5. Exercises
    1. 3.1. Building a constraint-satisfaction problem framework
    2. 3.2. The Australian map-coloring problem
    3. 3.3. The eight queens problem
    4. 3.4. Word search
    5. 3.5. SEND+MORE=MONEY
    6. 3.6. Circuit board layout
    7. 3.7. Real-world applications
    8. 3.8. Exercises
    1. 4.1. A map as a graph
    2. 4.2. Building a graph framework
    3. 4.3. Finding the shortest path
    4. 4.4. Minimizing the cost of building the network
    5. 4.5. Finding shortest paths in a weighted graph
    6. 4.6. Real-world applications
    7. 4.7. Exercises
    1. 5.1. Biological background
    2. 5.2. A generic genetic algorithm
    3. 5.3. A naive test
    4. 5.4. SEND+MORE=MONEY revisited
    5. 5.5. Optimizing list compression
    6. 5.6. Challenges for genetic algorithms
    7. 5.7. Real-world applications
    8. 5.8. Exercises
    1. 6.1. Preliminaries
    2. 6.2. The k-means clustering algorithm
    3. 6.3. Clustering governors by age and longitude
    4. 6.4. Clustering Michael Jackson albums by length
    5. 6.5. K-means clustering problems and extensions
    6. 6.6. Real-world applications
    7. 6.7. Exercises
    1. 7.1. Biological basis?
    2. 7.2. Artificial neural networks
    3. 7.3. Preliminaries
    4. 7.4. Building the network
    5. 7.5. Classification problems
    6. 7.6. Speeding up neural networks
    7. 7.7. Neural network problems and extensions
    8. 7.8. Real-world applications
    9. 7.9. Exercises
    1. 8.1. Basic board game components
    2. 8.2. Tic-tac-toe
    3. 8.3. Connect Four
    4. 8.4. Minimax improvements beyond alpha-beta pruning
    5. 8.5. Real-world applications
    6. 8.6. Exercises
    1. 9.1. The knapsack problem
    2. 9.2. The Traveling Salesman Problem
    3. 9.3. Phone number mnemonics
    4. 9.4. Real-world applications
    5. 9.5. Exercises
    1. B.1 Python
    2. B.2 Algorithms and data structures
    3. B.3 Artificial intelligence
    4. B.4 Functional programming
    5. B.5 Open source projects useful for machine learning
    1. C.1 What are type hints?
    2. C.2 What do type hints look like?
    3. C.3 Why are type hints useful?
    4. C.4 What are the downsides of type hints?
    5. C.5 Getting more information
    Show and hide more

    Product information

    You might also like

    Check it out now on O’Reilly

    Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.