Gift Guide

Algorithms in a Nutshell

( 4 )


Creating robust software requires the use of efficient algorithms, but programmers seldom think about them until a problem occurs. Algorithms in a Nutshell describes a large number of existing algorithms for solving a variety of problems, and helps you select and implement the right algorithm for your needs — with just enough math to let you understand and analyze algorithm performance.

With its focus on application, rather than theory, this book provides efficient code ...

See more details below
$31.47 price
(Save 37%)$49.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (19) from $4.03   
  • New (6) from $25.48   
  • Used (13) from $4.03   
Algorithms in a Nutshell

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$22.99 price
(Save 42%)$39.99 List Price


Creating robust software requires the use of efficient algorithms, but programmers seldom think about them until a problem occurs. Algorithms in a Nutshell describes a large number of existing algorithms for solving a variety of problems, and helps you select and implement the right algorithm for your needs — with just enough math to let you understand and analyze algorithm performance.

With its focus on application, rather than theory, this book provides efficient code solutions in several programming languages that you can easily adapt to a specific project. Each major algorithm is presented in the style of a design pattern that includes information to help you understand why and when the algorithm is appropriate.

With this book, you will:

  • Solve a particular coding problem or improve on the performance of an existing solution
  • Quickly locate algorithms that relate to the problems you want to solve, and determine why a particular algorithm is the right one to use
  • Get algorithmic solutions in C, C++, Java, and Ruby with implementation tips
  • Learn the expected performance of an algorithm, and the conditions it needs to perform at its best
  • Discover the impact that similar design decisions have on different algorithms
  • Learn advanced data structures to improve the efficiency of algorithms

With Algorithms in a Nutshell, you'll learn how to improve the performance of key algorithms essential for the success of your software applications.

Read More Show Less

Product Details

  • ISBN-13: 9780596516246
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 10/1/2008
  • Series: In a Nutshell (O'Reilly) Series
  • Edition number: 1
  • Pages: 364
  • Sales rank: 525,206
  • Product dimensions: 5.90 (w) x 8.90 (h) x 1.10 (d)

Meet the Author

George Heineman is an Associate Professor of Computer Science at WPI. His research interests are in Software Engineering. He co-edited the 2001 book "Component-Based Software Engineering: Putting the Pieces Together". He was the Program Chair for the 2005 International Symposium on Component-Based Software Engineering.

Gary Pollice is a self-labeled curmudgeon (that's a crusty, ill-tempered, usually old man) who spent over 35 years in industry trying to figure out what he wanted to be when he grew up. Even though he hasn't grown up yet, he did make the move in 2003 to the hallowed halls of academia where he has been corrupting the minds of the next generation of software developers with radical ideas like, "develop software for your customer, learn how to work as part of a team, design and code quality and elegance and correctness counts, and it's okay to be a nerd as long as you are a great one."

Gary is a Professor of Practice (meaning he had a real job before becoming a professor) at Worcester Polytechnic Institute. He went to WPI because he was so impressed with the WPI graduates that he's worked with over the years. He lives in central Massachusetts with his wife, Vikki, and their two dogs, Aloysius and Ignatius. When not working on geeky things he ... well he's always working on geeky things. You can see what he's up to by visiting his WPI home page at: Feel free to drop him a note and complain or cheer about the book.

Stanley Selkow received a BS in Electrical Engineering from Carnegie Institute of Technology in 1965, and then a Ph.D. in the same area from the University of Pennsylvania in 1970. From 1968 to 1970 he was in the Public Health Service at the National Institutes of Health at Bethesda Maryland. Since 1970 he has been on the faculty at universities in Knoxville TN and Worcester MA, as well as Montreal, Chonqing, Lausanne and Paris. His major research has been in graph theory and algorithm design.

Read More Show Less

Table of Contents

Principle: Use Real Code, Not Pseudocode;
Principle: Separate the Algorithm from the Problem Being Solved;
Principle: Introduce Just Enough Mathematics;
Principle: Support Mathematical Analysis Empirically;
Contents of This Book;
Conventions Used in This Book;
Using Code Examples;
Comments and Questions;
Safari® Books Online;
Part I: I;
Chapter 1: Algorithms Matter;
1.1 Understand the Problem;
1.2 Experiment if Necessary;
1.3 Side Story;
1.4 The Moral of the Story;
1.5 References;
Chapter 2: The Mathematics of Algorithms;
2.1 Size of a Problem Instance;
2.2 Rate of Growth of Functions;
2.3 Analysis in the Best, Average, and Worst Cases;
2.4 Performance Families;
2.5 Mix of Operations;
2.6 Benchmark Operations;
2.7 One Final Point;
2.8 References;
Chapter 3: Patterns and Domains;
3.1 Patterns: A Communication Language;
3.2 Algorithm Pattern Format;
3.3 Pseudocode Pattern Format;
3.4 Design Format;
3.5 Empirical Evaluation Format;
3.6 Domains and Algorithms;
3.7 Floating-Point Computations;
3.8 Manual Memory Allocation;
3.9 Choosing a Programming Language;
3.10 References;
Part II: II;
Chapter 4: Sorting Algorithms;
4.1 Overview;
4.2 Insertion Sort;
4.3 Median Sort;
4.4 Quicksort;
4.5 Selection Sort;
4.6 Heap Sort;
4.7 Counting Sort;
4.8 Bucket Sort;
4.9 Criteria for Choosing a Sorting Algorithm;
4.10 References;
Chapter 5: Searching;
5.1 Overview;
5.2 Sequential Search;
5.3 Binary Search;
5.4 Hash-based Search;
5.5 Binary Tree Search;
Chapter 6: Graph Algorithms;
6.1 Overview;
6.2 Depth-First Search;
6.3 Breadth-First Search;
6.4 Single-Source Shortest Path;
6.5 All Pairs Shortest Path;
6.6 Minimum Spanning Tree Algorithms;
6.7 References;
Chapter 7: Path Finding in AI;
7.1 Overview;
7.2 Depth-First Search;
7.3 Breadth-First Search;
7.4 A*Search;
7.5 Comparison;
7.6 Minimax;
7.7 NegMax;
7.8 AlphaBeta;
7.9 References;
Chapter 8: Network Flow Algorithms;
8.1 Overview;
8.2 Maximum Flow;
8.3 Bipartite Matching;
8.4 Reflections on Augmenting Paths;
8.5 Minimum Cost Flow;
8.6 Transshipment;
8.7 Transportation;
8.8 Assignment;
8.9 Linear Programming;
8.10 References;
Chapter 9: Computational Geometry;
9.1 Overview;
9.2 Convex Hull Scan;
9.3 LineSweep;
9.4 Nearest Neighbor Queries;
9.5 Range Queries;
9.6 References;
Part III: III;
Chapter 10: When All Else Fails;
10.1 Variations on a Theme;
10.2 Approximation Algorithms;
10.3 Offline Algorithms;
10.4 Parallel Algorithms;
10.5 Randomized Algorithms;
10.6 Algorithms That Can Be Wrong, but with Diminishing Probability;
10.7 References;
Chapter 11: Epilogue;
11.1 Overview;
11.2 Principle: Know Your Data;
11.3 Principle: Decompose the Problem into Smaller Problems;
11.4 Principle: Choose the Right Data Structure;
11.5 Principle: Add Storage to Increase Performance;
11.6 Principle: If No Solution Is Evident, Construct a Search;
11.7 Principle: If No Solution Is Evident, Reduce Your Problem to Another Problem That Has a Solution;
11.8 Principle: Writing Algorithms Is Hard—Testing Algorithms Is Harder;
Part IV: IV;
Appendix A: Benchmarking;
A.1 Statistical Foundation;
A.2 Hardware;
A.3 Reporting;
A.4 Precision;
About the Authors;

Read More Show Less

Customer Reviews

Average Rating 4.5
( 4 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Posted March 23, 2009

    Delivers as advertised

    The book does not aim to be an introduction to, nor the definitive encyclopedia on, the subject of algorithms.

    It is intended, as advertised on the cover, as "A Desktop Quick Reference". In the Preface it states that the goal is to provide a useful tool for working programmers to find good solutions to the problems they solve.

    As a self-taught programmer I am finding this book interesting to better understand the various ways that the same problem can be solved, and the pros and cons of each. While the book is mainly intended to help programmers review and select appropriate algorithms for a problem at hand, I am using it as a study guide and have enjoyed it as such thus far. While it doesn't exactly make for light reading, each algorithm is considered individually, which makes for a decent size chunk of information which can be considered independently.

    Multiple languages (C, C++, Java, Ruby) are used throughout the book in demonstrating the algorithms, solutions are not provided in each language for each algorithm. However, if you are using this as a study guide, this can provide a good exercise to translate the solution into the language of your liking.

    2 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted November 17, 2013

    No text was provided for this review.

  • Anonymous

    Posted March 24, 2011

    No text was provided for this review.

  • Anonymous

    Posted April 11, 2011

    No text was provided for this review.

Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)