Algorithms in a Nutshell
Publisher: O'Reilly Media
Final Release Date: October 2008
Pages: 364

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.

Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyAlgorithms in a Nutshell
 
4.2

(based on 6 reviews)

Ratings Distribution

  • 5 Stars

     

    (2)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (1)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Concise (4)
  • Easy to understand (4)
  • Helpful examples (4)

Cons

    Best Uses

    • Intermediate (4)
    • Student (4)

    Reviewed by 6 customers

    Sort by

    Displaying reviews 1-6

    Back to top

     
    4.0

    Great for students!

    By Linus von Doom

    from Stockholm, Sweden

    About Me Student

    Pros

    • Concise
    • Easy to understand
    • Helpful examples

    Cons

    • Not comprehensive enough
    • Too basic

    Best Uses

    • Intermediate
    • Student

    Comments about oreilly Algorithms in a Nutshell:

    As a student, this book really helped me understand algorithms when I had a hard time with the course literature.

     
    4.0

    good as a reference

    By edz

    from bay area, ca

    Verified Buyer

    Comments about oreilly Algorithms in a Nutshell:

    very practical consideration of algorithms

     
    5.0

    Concise to and on the point

    By Old Codger

    from San Diego

    About Me Designer, Developer

    Verified Reviewer

    Pros

    • Accurate
    • Concise
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice
      • Student

      Comments about oreilly Algorithms in a Nutshell:

      I liked this book tremendously, because its small and covers some complex material in an easy to read and comprehend manner. Best of all - the book writing style stays focussed and on point which is great! It goes into sufficient detail for an implementer, and gracefully points out limitations and shortcomings. The authors are especially helpful and provide code and pointers to other references if deeper insight is sought. I even had an email exchange with one of the authors in which they were extremely helpful. I keep this book on my close reach shelf!

      (6 of 7 customers found this review helpful)

       
      4.0

      An Approachable Take on Algorithms

      By Jen

      from St. Louis, MO

      About Me Developer, Student

      Verified Reviewer

      Pros

      • Concise
      • Easy to understand
      • Helpful examples

      Cons

        Best Uses

        • Intermediate
        • Student

        Comments about oreilly Algorithms in a Nutshell:

        When I first encountered algorithms as a student, I was convinced that I would never "get" them. The textbooks that I had been assigned just didn't treat the subject in a way that made sense -- everything was very lofty and theoretical, and it was hard to make the leap from all that theory into code that I could use. I decided to take a chance on revisiting the subject, and I'm glad that "Algorithms in a Nutshell" was the book I chose.

        The examples in this book make sense. The game tree discussion in Chapter 7 really locked things in for me -- the example is useful, realistic, and interesting. It's refreshing. I pulled out my old data structures and algorithms textbook and compared their treatments of quicksort, and I still can't make much sense of the overly-theoretical descriptions in the other book. The neat and tidy quicksort fact sheet? Totally resonates with me. The code samples match up well to the analysis, and I'm pleased with my level of understanding now.

        In the "not so great" column: this isn't a book for novices. As much as I didn't feel like an expert on algorithms before picking up this book, I was at least aware of the basics. The book is great as a refresher, or for filling in the gaps that an overly-theoretical treatment can cause, but it would probably be overwhelming for a novice programmer or a young student.

        (5 of 6 customers found this review helpful)

         
        5.0

        Best practical book on algorithms

        By Ate's helper

        from Southborough MA

        About Me Maker

        Verified Reviewer

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate
          • Novice
          • Student

          Comments about oreilly Algorithms in a Nutshell:

          This excellent book fills a long unmet need for a practical "how-to" manual on the efficient use of algorithms. This text will be helpful to recent graduates as well as anyone who is faced with the problem of selecting from many potential algorithms as they write their software program. The lead author is a respected professor who writes in a clear easy to understand style. The algorithms can be downloaded from the web. There is also a blog site which explores additional areas not covered in the book. O'Reilly has certainly published a worthwhile and needed text.

          (26 of 31 customers found this review helpful)

           
          3.0

          Strongest in its disciplined presentation of pseudo-code

          By Roger

          from Undisclosed

          Comments about oreilly Algorithms in a Nutshell:

          The short history of computer science has sparkled with some extraordinary insights into getting jobs done efficiently. In some ways those jobs are familiar, such as moving the maximum volume of stock from factories through distribution channels to shops. Or sorting a directory of names into alphabetical order. But the solutions that have been found in recent years are genuinely new, and interesting to read about.

          This book takes us through the development of several classes of algorithms, such as from "sequential search", through "binary search" to "binary tree search" and a "hash based search". Similarly, it explores sorting into order, finding connected nodes in a graph, planning winning moves in a game, allowing a maximum flow through a network, and geometric problems like the closest points in a set to a new point. The algorithms are presented in order of complexity, building up each topic and explaining both the method and performance of each. Each one covers several pages, including a pseudo-code listing, an actual listing in a language like C++ or Java (supported by the full source code in an archive somewhere), performance statistics and a discussion. The building-up means that many of the algorithms presented are of little interest to practical implementors, however.

          The authors are rightly proud of each page that summarises an algorithm. The pseudo code, although variable in style, is mostly very clear and easy to follow. Each algorithm is presented with a diagram demonstrating its progress in an example highlighting the key lines of code. The actual source code can be used if you're implementing it, but since most of the algorithms are presented to teach an approach, using them directly is not necessary. A few lines of pseudo code are too abstract, such as "find median value" or "find augmenting path".

          One of the most interesting things about efficient algorithms is the way that they make simplifying assumptions about the data; perhaps that no two items in a set can be unique, or perhaps that data is stored in a balanced structure. Indeed the book begins with a case study of a memory leak analysis tool which was terribly slow to run. It used a tree to store the allocated blocks, but unfortunately the sequence in which blocks were assigned from the heap meant that this tree turned out more like a linked list!

          That question of using the right data structures is hinted at repeatedly, and often enforced within the algorithms, but I felt that a programmer working with such problems could benefit from some further guidance through the initial steps of considering "what kind of operations will I want to perform on my data?". Getting the right structure, or caching intermediate results is often vital to efficient performance. The authors recognised this, but didn't help much with the decisions.

          Performance is always discussed in terms of run-time and has been measured on just a desktop PC, and a really big PC. There are more embedded devices with relatively tiny resources in use, and a few important data-centre mainframes, which the authors disregard.

          The balance of topics in the book seems to be aimed at a student revising algorithm design. But the lectures on floating point inequality, pointers, and the importance of freeing allocated memory, seem out of place. The statistics are not built on the strongest foundations (the methods and explanations are a bit suspect, and some graphs are difficult to read). Some terms are defined in detail, such as "secondary storage" whereas others are not, such as "median".

          There are a few errors in diagrams, and an extraordinary non-sequiteur over the turn of a page, from user authentication to graph-spanning paths, which had be flipping the page several times to see if I had missed something. Although locally confusing, they didn't put me off my stride.

          The key question that the book sets out to answer, of how to choose the best algorithm for a problem that needs to be delivered on Friday, remains somewhat elusive. There are few real-world examples of data sets that fit the algorithms described, and I felt that more space could have been given to a wider range of algorithms instead of the academic development of a single type of algorithm.

          The book ends with an excellent couple of chapters; on the kind of assumptions you can make to convert your data into a well known case, and the "principles" that all software engineering with heavy duty algorithms should consider.

          In summary, the book is strongest in its disciplined presentation of pseudo-code and structured sections answering the same questions about each topic. However, the ideal target audience for it would seem to be limited to students, rather than real software engineers.

          Displaying reviews 1-6

          Back to top

           
          Buy 2 Get 1 Free Free Shipping Guarantee
          Buying Options
          Immediate Access - Go Digital what's this?
          Ebook: $39.99
          Formats:  APK, DAISY, ePub, Mobi, PDF
          Print & Ebook: $54.99
          Print: $49.99