Customer Reviews


11 Reviews
5 star:
 (10)
4 star:
 (1)
3 star:    (0)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
Share your thoughts with other customers
Create your own review
 
 
Only search this product's reviews
‹ Previous | 1 2 | Next ›
Most Helpful First | Newest First

59 of 62 people found the following review helpful:
5.0 out of 5 stars Best algorithms textbook by far, May 21, 2011
By 

"Algorithms" (4th edn) by Robert Sedgewick and Kevin Wayne (published
by Addison-Wesley in March 2011) is one of the best computer science
books I have ever read. It should be required reading for all CS
students and all programmers - it aims to cover the "50 algorithms
every programmer should know". Below I discuss some of the main
reasons why I think the book is so good.

Unlike its main rival, "An introduction to algorithms" by Cormen,
Leiserson, Rivest and Stein (CLRS), "Algorithms" contains actual
source code (written in a subset of Java). The importance of this
cannot be overstated: it means students can actually use the
algorithms to solve real problems. This enables a wealth of
interesting and motivating applications --- from web search to
genomics --- which are sprinkled throughout the book. (Source code and
data are available on the book's website.)

A natural worry with real code is that it will obscure the basic
ideas. However, by careful useful of abstract data types (classes
such as queues, bags, hash tables, trees, DAGs, etc), the authors have
done a masterful job at creating extremely concise and readable
implementations.

Using real code also forces one to address important implementation
details that are easy to overlook. For example, it is well known that
mergesort requires auxiliary memory. In the CLRS pseudocode, they
allocate temporary storage space inside their merge routine. In
practice it is much more efficient to allocate temporary storage space
once, and then pass this in as a pointer to the merge function (or let
it be a private member of the mergesort class). Where else can you
learn such important tricks?

In addition to presenting the code, there are of course accompanying
English explanations of the methods, which are very clear. One unique
thing about "Algorithms" is that there are also many detailed worked
examples, illustrating the behavior of the algorithms while running on
actual data (something that is hard to do unless you actually
implement all the algorithms!)

Another strength is that the book is that exemplifies good software
engineering practice: write the API first, devise unit tests and/or
implement applications ("clients") that use the data structure or
algorithm, and only then worry about how to implement the
API. Furthermore, multiple implementations of the API are usually
discussed, with different tradeoffs between simplicity, speed and
memory use.

For data structures, it is obviously natural to use classes, but they
also adopt this approach for many algorithms, esp. graph processing
ones. This allows the algo to do pre-processing and to store internal
state, and then to provide a service to the caller. This is more
general than the standard stateless functional view of algorithms.

Each section of the book has a large number of exercises, classified
into "simple", "creative" and "experimental". Solutions to some
exercises are available online.

An unusual feature of the book is that it contains a lot of empirical
algorithmics, in addition to theory. That is, it shows actual running
times of different implementations on problems of different sizes, and
uses this to supplement traditional theoretical analysis.

A small bonus relative to CLRS is that the book is slightly shorter
(~ 1000 pages instead of 1300). In addition it is available in Kindle
format, which means one just has to carry around an ipad instead of a
back-breaking tome. (The formatting of the Kindle edition is not
perfect, however.)

Not surprisingly, the content of "Algorithms" overlaps a lot with
CLRS. This is not obvious from the table of contents, which only
gives a high level view of the book. I have therefore created a more
detailed list of topics (see below).

The overall ordering and flow of the book is great: ideas (and code)
that are introduced early on get re-used in several places later in
the book (e.g., heaps -> priority queues -> Prim's algo for min
spanning trees). The topics also become more advanced. Consequently,
the book is best read sequentially. It is worth reading the whole thing.


Kevin Murphy
Prof. of Computer Science
University of British Columbia


Below I give a detailed summary of the topics in the book,
since this is not apparent from the table of contents.

1. Fundamentals

1.1 Basic programming model
- Intro to Java
- APIs and libraries
- Binary search (recursion)

1.2 Data abstraction
- Basics of OOP
- Avoiding 'wide' interfaces

1.3 Bags, queues and stacks
- Generics (known as templates in C++)
- Iterators
- Dijkstra's 2 stack algo for evaluating arithmetic expressions
- Resizing arrays
- Linked lists, pointers

1.4 Analysis of algorithms
- empirical algorithmics
- big O notation ("linearithmic" as a term for O(N log N))
- Randomized algorithms
- Memory usage

1.5 Case study: Union-find
- Application: Dynamic connectivity (are p,q in same set?)
- 3 implementations, culminating in the classic algorithm



2. Sorting

2.1 Elementary sorts
- Selection sort
- insertion sort
- shell sort

2.2 Mergesort
- Top-down (recursive)
- Proof that running time is N log N
- Bottom-up
- proof that lower bound for sorting requires N log N compares

2.3 Quicksort
- implementation
- analysis
- 3 way partitioning to speedup case of equal keys
- lower bound for sorting is N*entropy of key distrib.

2.4 Priority queues
- heaps
- priority queue,
- top N items from a list using PQ
- multiway merge of N sorted lists using indexed PQ
- heapsort
- comparison of sorting algos (speed, stability, in place, extra space)
- order statistics/ median finding in O(N) time


3. Searching

3.1 Symbol tables (aka associative arrays)
- ST vs ordered ST (where keys can be compared, so can get min and max)
- count word frequencies in a large document
- sequential search through unordered linked list
- binary search through ordered array

3.2 Binary search trees
- BST property (parent is bigger than left child, smaller than right)
- get and put implementation and analysis O(log N) time
- find min, delete min, delete any node
- inorder traversal

3.3 Balanced search trees
- 2-3 trees and red-black trees

3.4 Hash tables
- hash functions (eg modular hashing with Horner's rule)
- separate chaining
- linear probing

3.5 Applications
- Deduplication
- Dictionary lookup
- inverted index
- file index
- sparse matrix vector multipication

4. Graphs

4.1 Undirected graphs
- Adjacency list representation
- Depth first search
- Breadth first search
- single source shortest paths using bfs
- connected components usign dfs
- is G acyclic using dfs
- is G bipartite using dfs
- Kevin Bacon game (degrees of separation)

4.2 Directed graphs
- Multi-source reachability
- Application to mark-sweep garbage collection
- Cycle detection using dfs
- topological sort (reverse of post order)
- Kosaraju's algo for strongly connected components
- Transitive closure (all pairs reachability)

4.3 Min spanning trees of undirected weighted graphs
- Prim's algo
- Kruskal's algo

4.4 Shortest paths in weighted digraphs
- Dijkstra's algo
- Shortest paths in weighted (possibly -ve) DAGs
- Critical path method for scheduling
- Shortest paths in weighted cyclic digraphs (Bellman-Ford and -ve cycle detection )
- Application to arbitrage


5. Strings

5.1 String sorts
- key indexed counting (radix sort)
- least significant digit (LSD) sorting
- most significant digit (MSD) sorting for variable length strings
- 3-way string quicksort for repeated prefixes.

5.2 Tries
- R-way trie
- longestPrefixOf
- Ternary search tries (BST representation of R-way array)

5.3 Substring search
- brute force method
- KMP method
- Boyer-Moore method
- Rabin-Karp fingerprint


5.4 Regular expressions
- Syntax of regexp
- Check if string in language using non-deterministic finite automaton

5.5 Data compression
- Setup
- Run-length encoding
- Huffman compression
- LZW compression (using tries)


6. Context

6.1 Event driven simulation using PQs

6.2 B-trees

6.3 Suffix arrays.
- Find longest repeated substring.
- Indexing a string (keyword in context)

6.4 Ford-Fulkerson maxflow.
- Find shortest augmenting path.
- Maximum bipartite matching reduces to maxflow
- maxflow and shortest paths reduce to linear programming

6.5 NP completeness





Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


11 of 12 people found the following review helpful:
5.0 out of 5 stars Good introductory text, October 14, 2004
By 
Bjørn Borud (Trondheim, Norway) - See all my reviews
(REAL NAME)   
This review is from: Algorithms (Hardcover)
I found this book at a university book shop back when I was 14 years old and bought it to learn more about certain algorithms. The reason I bought it was because it looked like it would provide very concrete advice on how to achieve an implementation while not requiring more advanced mathematics than I knew at the time.

Now, many years later I have to say that I can't think of any algorithm book I've come across that manages to balance theory and concrete solutions so well; and I own quite a few books on algorithms. (Some might object to the fact that the book uses Pascal as the implementation language, but I think I've seen this book tailored for other languages too).

Also, for a general book on algorithms, Sedgewick managed to pick a very good mix of topics to cover. According to a friend of mine (whom happens to know Sedgewick personally), the book just represents a cross-section of what Sedgewick himself was interested in.

This book was very useful to me when I was a teenager starting to understand bread and butter algorithms, and it continues to be a good reference still to this day. I would recommend you buy this book if you need a good book on fundamental algorithms.

(Also, the typography is very sober and clean, and the illustrations to most of the problems are very clear)
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


10 of 11 people found the following review helpful:
5.0 out of 5 stars Updated Review For Fourth Edition, April 11, 2011
Other reviews on this fine text are for older editions with pseudo code. Sedgewick and Wayne have completely revised this new Fourth Edition with plentiful Java scripts for a vast range of applications. A brand new website at Princeton is dedicated to this book and has visualizations, much more code, exercises, answers, bib links, full implementations of many problems, and a complete online summary and synopsis of the book.

The authors suggest this is for a second course in CS, but many serious students, whether independent or in undergrad, will find it useful for self teaching as well. In fact, the new website has self teaching resources if you are "going it alone" in your initial study of algorithms.

Algos cannot really be separated from their underlying data structures, and a serious new addition to this printing and edition is a much better backgrounder on the most up to date data structures, using hyper modern examples like Amazon and Google.

This book covers the basics, and is not an encyclopedia or reference book. It has a lot of detailed descriptions and visuals, and takes the time to be sure the student "gets" the point. In a way, it is in competition with Sedgewick's own Algorithms in C++, Parts 1-4: Fundamentals, Data Structure, Sorting, Searching (Pts. 1-4), which is now in its third edition, and more terse, advanced and encyclopedic. If you want a thorough understanding of the whole field, you probably need both if you're just starting out in the field.

If you're a beginning programmer, and want to get into the underlying logic of sorts, searches, graphs, strings and other fundamentals that drive modeling and the web, this is the place to start.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


19 of 25 people found the following review helpful:
4.0 out of 5 stars Can Programs Teach Algorithms?, January 4, 2001
By 
Dennis E. Hamilton "orcmid" (Seattle, WA United States) - See all my reviews
(REAL NAME)   
This review is from: Algorithms (Hardcover)
This book presents an interesting challenge. It talks about algorithms yet it does not present algorithms, nor does it define algorithm as anything more than a "problem-solving method suitable for implementation as computer programs[p.4]." Instead, it exhibits programs which are the implementations of algorithms and discusses them as if the algorithm is apparent. The reader is left with the challenge of learning to discriminate between what is essential about an algorithm, and how to preserve that in an implementation, versus what is inessential to the algorithm and introduced on account of the implementation and the use of particular programming tools.

I am concerned that this approach, while well-motivated, is not successful. My evidence is in the criticisms of this and later editions that dwell on the choice of programming language and on stylistic matters in the use of the chosen language. This places too much emphasis on code. Although code rules these days, I remain unconvinced that this simplification is a good thing. For me, one of the great insights in development of software is identification of layers of abstraction for conquering the organization of complex application programs. Separating design, algorithm and implementation is a critical first step toward that mastery.

Meanwhile, "Algorithms" serves up a handy set of recipes for a variety of basic computing situations. The 45 sections cover fundamental methods of widespread application in computing and software development. The presentations are straightforward and illuminating. The compilation bears re-examination every time one sits down to identify key methods for a new application.

I recommend supplementing this material with the practical methods of Kernighan and Plauger's "Software Tools" and the insightful explorations of Bentley's "Programming Pearls." Most of all I encourage development of enough sense of the material in Donald Knuth's "Art of Computer Programming" to be able to read the discussions of algorithms and problems there, even if you never use the particular implementations.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


4 of 4 people found the following review helpful:
5.0 out of 5 stars Excellent for re-learning the basics, August 23, 2011
By 
Amazon Verified Purchase(What's this?)
After 20 years doing kernel level programming and device drivers, process control systems and other realtime work, most of my algorithm knowledge has vanished from disuse. So now I'm moving back into higher-level work and I was in trouble!

This books covers it all, and it's far more readable than the Knuth books I grew up on. I really appreciate the implementation examples as well, a few unclear spots became obvious when I looked at the code.

For anyone shifting gears and needing to freshen up their programming basics, I highly recommend this book!
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


10 of 13 people found the following review helpful:
5.0 out of 5 stars My favorite introduction to algorithms, August 8, 1997
This review is from: Algorithms (Hardcover)
Sedgewick provides a very clear and intuitive exposition of the essence of many algorithms.

The book covers a breadth of topics, from sorting and searching, to computational geometry and mathematical algorithms. It is an extremely well-written book. Each algorithm has been carefully implemented in Pascal (you may also want to have a look at the editions of the book for C++ and other languages). It is an excellent book, both for practitioners and programmers, as well as an introduction to the theory of algorithms!
Highly recommended!

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


3 of 3 people found the following review helpful:
5.0 out of 5 stars Excellent book, December 13, 2011
Amazon Verified Purchase(What's this?)
This is a great book for anyone who knows java and wants to understand Algorithms. This covers lot of basic Data Structures and Algorithms written in Java with generics. I have read lot of data structure and algorithm books, but this one especially is for java programmers. Most of the algorithm books, only cover the basic pseudo code and leave the implementation, but this one gives a complete implementation of most of the famous algorithms. One more thing, I like particularly about the book is the supporting website, which has lot of test data and the author has provided test cases for each of the programs given in the book.

This is not all, every chapter comes with lot of interesting compilation of exercises and creative problem, which will make your fundamentals clear. I think it is a must read for anyone who wants to really brush up on their data structure and algorithms fundamentals.

Thanks for writing this great book.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 3 people found the following review helpful:
5.0 out of 5 stars Pretty good book covering the basics of algorithms, December 21, 2011
Amazon Verified Purchase(What's this?)
I got this book just before Thanksgiving break. I had the plan to finish as much as possible during the Thanksgiving break.
I had earlier read Sedgewick's Algorithms book (C++ version).
So comparing to that, this Java version is similarly organized.
The basics are touched comprehensively in this book as well: heaps, priority queues, sorting - quick sort, merge sort, stacks, queues, binary trees, tries and so on.
I liked the fact that since this was a Java version, authors kept in mind to discuss details of the object organization as well. So things like how much memory a string object occupies was good to learn from this book.
This book touches in detail algorithms like Substring search (Boyer moore, Rabin Karpe) and has a whole chapter devoted to strings.
So datastructures like tries are covered as well in good details.
Also I liked the fact that authors made it a point to refer to the current real world applications whenever possible - for example application of dictionary lookup in Page rank algorithm was another good learning.

There are some sections extra in this book campared to the C++ version.
Overall a satisfactory book, a must-have for software engineers.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 4 people found the following review helpful:
5.0 out of 5 stars A classic when looking for information about algorithms, October 25, 2003
By 
Knud van Eeden (Rijswijk-ZH Holland) - See all my reviews
This review is from: Algorithms (Hardcover)
When having to solve problems regarding algorithms, this book is one of the frequently used books. It shows besides the interesting details also the larger overview, which certainly adds to your better understanding.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


4 of 8 people found the following review helpful:
5.0 out of 5 stars Excellent text on basic algorithms - too bad it's Pascal, September 29, 1999
By 
learjeff "learjeff" (Durham, NC United States) - See all my reviews
This review is from: Algorithms (Hardcover)
This text covers the most useful material presented in Knuth's seminal series, but is much more readable in Pascal than in Knuth's notation, which was based on programming language concepts of the late 60's.

The example code is actually run by the typesetting system to generate the graphs showing the operation or efficiency of the algorithm, so you have a high confidence factor in the example code. Too bad it's in Pascal -- which is probably why this book is out of print.

I was very surprised at the low ratings awarded by reviewers to the paperback edition of Sedgewick's "Algorithms in C" -- yet there were good reviews of the hardcover edition. Evidently the example C code didn't meet the high standards of the Pascal version.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


‹ Previous | 1 2 | Next ›
Most Helpful First | Newest First

This product

Algorithms (Addison-Wesley series in computer science)
Algorithms (Addison-Wesley series in computer science) by Robert Sedgewick (Hardcover - June 1983)
Used & New from: $0.16
Add to wishlist See buying options