Algorithms (4th Edition)

brief introduction

  • Sedgewick's masterpiece, with the same strain Gartner TAOCP
  • For decades multiple revisions, enduring bestseller
  • It covers 50 kinds of algorithms all programmers must master

"Algorithm (4th edition)," a comprehensive overview of the necessary knowledge of algorithms and data structures, with the following major features.

  1. Classic reference book in the field of algorithms: Sedgewick best-selling book, after decades reflects the evolved algorithms knowledge system;
  2. Comprehensive: a comprehensive discussion of algorithms and data structures, sorting, searching, graph processing and string handling, covering 50 kinds of algorithms every programmer should be aware of the;
  3. The new revision of the Code: The new Java implementation code, modular programming style, all code readers are available for use;
  4. Combined with the practical application: To investigate the algorithm in important scientific, engineering and commercial applications environment, given the actual code algorithm, rather than the usual pseudo-code similar works;
  5. Full of intellectual interesting: concise content, rich with examples of visual elements presented, well-designed code, detailed historical and scientific background, a variety of difficult exercises, all this will make the reader put it down;
  6. Scientific method: using the appropriate mathematical model to accurately discuss the performance of the algorithm, these models are proven in the real world;
  7. Combined with the network: algs4.cs.princeton.edu companion Web site provides a summary of the book's content and resources related code, test data, programming exercises, teaching courseware.

About the Author

Robert Sedgewick, Ph.D., Stanford University, tutor for the Donald E.Knuth, since 1985 has served as professor in the Department of Computer Science, Princeton University, he served as the Head of the Department, also a member of the board of directors AdobeSystems company, worked in Xerox, PARC Institute for Defense Analyzes (Institute for DefenseAnalyses) and the French national Institute of information and automation (INRIA) engaged in research work. His research include resolving combinatorics, Analysis and Design of data structures and algorithms, and visualization programs.

KevinWayne, Dr. Cornell University, Senior Lecturer, Department of Computer Science research at Princeton University includes algorithm design, analysis and implementation, especially drawing and discrete optimization.

This book content

Translator's Preface

In the computer field, the algorithm is an eternal theme. Even if the book entry only aspect of the algorithm are laid out, it can add up to at home and abroad for fear that covered the entire Tiananmen Square. In these books, there are several different particular book is one of them.

This book is the student's mentor. In the translation process I have many times lamented: "! If I can have this book then that would be great," said the book should be tailored to the students. No mathematical basis? It does not matter, as long as you had in high school mathematical induction, then book mathematics content more than 95% of you are able to understand, not to mention the book also supplemented by a large number of legends. I never learned programming? It does not matter, Chapter 1 will introduce enough knowledge of Java, even if you are not a computer science student, will not encounter difficulties. The whole book content arrangement step by step, from easy to difficult, before and after the echo, which shows the author's good intentions. Nothing is more professional than the algorithm textbook book.

This book is a good helper teacher. If teachers can only scripted, we can only stay in the algorithm itself one thousand two hundred thirty-four stage, it has lagged far behind the times. The method of calculation algorithm is not just the process of exploring the algorithm is reflected in our way of knowing the world: is submissive to the Bible as a textbook, or through the "experiment - failure - and then experiment" temper cycle? Mathematics is to ensure that the data is validated. Book through a variety of algorithms, from all angles, many times that this truth, which is in Chapter 1 is the largest cause of a chapter of the book content. I hope every reader will not miss Chapter 1. Whether you have no programming foundation, will derive useful lessons.

This book is the programmer's mentor. After working for many years, quick sort, Huffman coding, etc. KMP once familiar concept in your mind is not already dying does not become a one term connotation? It's time to pick up them. Whether looking for clues to the job at hand, or trying to prepare for the next job, these algorithms are basics that you can not skip. Book emphasizes software engineering best practices, especially for experienced programmers have been working friends. All algorithms are first, API, and then have achieved, followed by proof, and finally the data. After this first interface, emphasizing the test of practice, undoubtedly fought for many years in the work of programmers are most familiar with.

The book also has some regret, did not introduce such dynamic planning such an important idea. But the fundamental, it is still the best entry-level algorithm book. I strongly hope that the book translated into Chinese, but also fear, in perpetuity, worried that their level is not sufficient to accurately convey the original meaning. The process of translation may be hard, but I think well worth it. Thank Telecom Press Turing company gave me this opportunity to thank the careful examination of expert editors and reviewers. At the same time thanks to the full support of my wife Zhu day. Limited level translator, bug inevitable, but also the reader criticism.

Xie Clouds

2012.9.17

Foreword

This book seeks to study today's most important computer algorithms and some of the most basic skills transfer to the general knowledge seekers. It is suitable for use as advanced computer science textbooks, for computer systems are already familiar with and master students basic programming skills. The book can also be used for self-study or as a developer's reference manual, because in the book to achieve a number of practical algorithms and detailed analysis of their performance characteristics and uses. This book is widely drawn, it is suitable as an introductory textbook in the field.

Learning algorithms and data structures are the foundation of all computer science teaching program, but it is not just useful for programmers and computer science students. Any computer user wants the computer can run faster or to solve the larger problem. The algorithms in this book represent a large number of outstanding research achievements of the past 50 years, people working in essential knowledge. From the physics of N -body simulations problem to problem gene sequences in molecular biology, we describe the basic method has been indispensable for scientific research; from building modeling systems to simulate an aircraft, these algorithms have become very important engineering tools; from the database system to the Internet search engine algorithms have become a modern software systems an integral part. This is just a few examples, with the continuous expansion of computer applications, the impact of these basic methods will continue to expand.

Before you start learning these basic algorithms, we need to be familiar with low-level abstract data type stacks, queues, etc. The book will be used in both. Followed by research base algorithm to sort, search, maps and the string area. The final chapter will summarize the contents of the book from a macro perspective.

uniqueness

The book dedicated to the research algorithm has practical value. The book explains the variety of algorithms and data structures, and provides a wealth of information, the reader should be able to have confidence achieved in a variety of computing environments, debug and apply them. The book features involves the following aspects.

Algorithms book had complete implementation of the algorithm, and discussed the health program on multiple swatch. Pseudocode program rather than the code book are run and therefore very easy to put into use. The book program is written in Java, but the programming style convenience of the reader to use other modern programming languages to reuse most of the code in which to achieve the same algorithm.

Data types we used in modern programming style data abstraction, the data structures and algorithms packaged together.

Application of each chapter of the algorithm is given scenario play a key role. These scenarios are varied and include physical simulation and molecular biology, computer and systems engineering, and we are familiar with data compression and network search.

Academic We attach great importance to use a mathematical model to describe the performance of the algorithm. We use the model to predict the performance of the algorithm, and then in a real environment, run the program to verify the prediction.

The breadth of the book discusses the basic abstract data types, sorting algorithms, search algorithms, maps and string processing. Our research data structure, algorithm design paradigm in the discussion of the algorithm, induction and problem-solving model. This classic method since the 1960s and in recent years produced a new method of covering.

Our main goal is to introduce the most important practical algorithm today to the widest possible group. These algorithms are generally very clever strange, about 20 lines of code enough to express. They show problem-solving ability is amazing. Without them, the creation of computational intelligence to solve scientific problems, developing commercial software is not possible.

Book website

A highlight of the book is its companion Web site algs4.cs.princeton.edu . The website for teachers, students and professionals, provides a wealth of information on algorithms and data structures for free.

An online syllabus includes the structure and contents of this book provide a link, the browser is very convenient.

All code that implements the book all the code can be found here, and in a form suitable for program development. Also included are other algorithm, such as advanced implementations, the book mentioned improvements implemented, client code portion and a plurality of answers to exercises scenarios. Our focus is to use a real application environment to test the algorithm.

Exercises and answer site also provides some additional multiple-choice questions (with just one click you can get answers), many examples of the application of algorithms, programming exercises and answers as well as some challenging puzzles.

Dynamic visualization of the book is dead, but the site is live, here we take full advantage of the graphics class to demonstrate the application effect of the algorithm.

Course Information Web site contains a complete set of slides and corresponding book and online content, as well as a series of programming assignments, checklists, test data and preparation manual.

Related information Links website contains a lot of links to provide more background learning algorithm and other resources algorithms.

We hope that this site and book complement each other. In general, the reader is advised when first learning an algorithm or want to read the whole concept, and the site as a reference when programming online, or find a starting point for more information.

As a textbook

This book is computer science advanced materials, covering the core of the discipline, and allows students the ability to program, quantitative reasoning and problem solving aspects of the full exercise. In general, had studied a pilot course in computers is enough, as long as familiar with a modern programming language and familiar with modern computer systems, they are able to read this book.

Although the book uses Java implementation of algorithms and data structures, but its code style makes familiar with other modern programming language people can understand. We take full advantage of Java's abstract (including generics), but does not depend on the unique characteristics of the language.

Most mathematical knowledge involves in the book has a complete explanation (a few have extended reading), and therefore does not need to read this book too mathematical knowledge, but there is a certain mathematical foundation course better. Scenarios are the basis of content from other disciplines, the same book is also a complete introduction.

This book deals with the basics of any student preparing major in computer science, electrical engineering, operations research and other professional should be aware of, and is very valuable to all students in science, mathematics or engineering interest.

Background

This book is intended to be a continuation of our basic textbook "Java Programming: A method of interdisciplinary", the book made a general introduction to the computer field. The two books together can be used as introductory courses in computer science textbooks two or three semesters, provide the necessary basic knowledge for all students to solve computational problems in natural sciences, engineering and social sciences.

Most of these essays from Sedgewick algorithms series of books. In essence, the book and the series version 1 and version 2 is closest, but also includes many years of experience in teaching and learning. Sedgewick's "C algorithm (3rd Edition)", "C ++ Algorithms (3rd Edition)", "Java Algorithms (3rd Edition)" is more suitable for use as reference materials or advanced courses, and this book is dedicated for university freshmen and sophomores design of a semester textbooks, reference books is the latest foundation primer or practitioners.

Acknowledgments

Writing the book took nearly 40 years, so you want to list all participants is impossible. Previous editions of this book lists a total of a few dozens of people, including (in alphabetical order) Andrew Appel, Trina Avery, Marc Brown, Lyn Dupré, Philippe Flajolet, Tom Freeman, Dave Hanson, Janet Incerpi, Mike Schidlowsky, Steve Summit and Chris Van Wyk. I want to thank all of them, although some contribution dates back a few decades ago. As for the fourth edition, we would like to thank trial hundreds of students at Princeton and other institutions proofs of the book, as well as comments and pointed out the error of readers around the world through the book's website.

We would also like to thank Princeton University staunch support for high-quality teaching, which is the basis of the book is available.

Peter Gordon almost from the beginning of the writing of this book put forward many useful suggestions, this version of the policy of "return to its source," the guiding ideology is his first proposed. About 4th edition, we would like to thank Barbara Wood serious and professional editing, Julie Nahil management of the production process, as well as friends Pearson publishing company and marketing for the book went to press hard work. Everyone is actively chasing progress, and the quality of the book was not affected in the slightest.

Chapter 1 basis (a)
Chapter 1 basis (b)
Chapter 1 basis (three)
Chapter 1 basis (four)
Chapter 2 Sort (a)
Chapter 2 sorting (b)
Chapter 2 Sort (c)
Chapter 2 Sort (four)
Chapter 3 Find (a)
Chapter 3 Finding (b)
Chapter 3 Finding (c)
Chapter 3 Finding (d)
Chapter 4 Figure (a)
Chapter 4 Figure (b)
Chapter 4 Figure (c)
Chapter 4 Figure (D)
Chapter 5 string (a)
Chapter 5 string (B)
Chapter 5 String (III)
Chapter 5 string (D)
Chapter 6 background (top)
Chapter 6 background (medium)

Read more: http://gitbook.cn/gitchat/geekbook/5d007178a734cc3011ebbba5

Guess you like

Origin blog.csdn.net/valada/article/details/92238480