Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewickâs best-selling series, reflecting an indispensable body of knowledge developed over the past several decades. Broad Coverage Full treatment of data structures and algorithms for sorting, searching, graph processing, and string processing, including fifty algorithms every programmer should know. See algs4.cs.princeton.edu/code. Completely Revised Code New Java implementations written in an accessible modular programming style, where all of the code is exposed to the reader and ready to use. Engages with Applications Algorithms are studied in the context of important scientific, engineering, and commercial applications. Clients and algorithms are expressed in real code, not the pseudo-code found in many other books. Intellectually Stimulating Engages reader interest with clear, concise text, detailed examples with visuals, carefully crafted code, historical and scientific context, and exercises at all levels. A Scientific Approach Develops precise statements about performance, supported by appropriate mathematical models and empirical studies validating those models. Integrated with the Web Visit algs4.cs.princeton.edu for a freely accessible, comprehensive Web site, including text digests, program code, test data, programming projects, exercises, lecture slides, and other resources. Contents Chapter 1: Fundamentals Programming Model Data Abstraction Bags, Stacks, and Queues Analysis of Algorithms Case Study: Union-Find Chapter 2: Sorting Elementary Sorts Mergesort Quicksort Priority Queues Applications Chapter 3: Searching Symbol Tables Binary Search Trees Balanced Search Trees Hash Tables Applications Chapter 4: Graphs Undirected Graphs Directed Graphs Minimum Spanning Trees Shortest Paths Chapter 5: Strings String Sorts Tries Substring Search Regular Expressions Data Compression Chapter 6: Context This fourth edition of Robert Sedgewick and Kevin Wayne's Algorithms is the leading textbook on algorithms today and is widely used in colleges and universities worldwide. This book surveys the most important computer algorithms currently in use and provides a full treatment of data structures and algorithms for sorting, searching, graph processing, and string processing -- including fifty algorithms every programmer should know. In this edition, new Java implementations are written in an accessible modular programming style, where all of the code is exposed to the reader and ready to use. The algorithms in this book represent a body of knowledge developed over the last 50 years that has become indispensable, not just for professional programmers and computer science students but for any student with interests in science, mathematics, and engineering, not to mention students who use computation in the liberal arts. The companion web site, algs4.cs.princeton.edu contains An online synopsis Full Java implementations Test data Exercises and answers Dynamic visualizations Lecture slides Programming assignments with checklists Links to related material The MOOC related to this book is accessible via the "Online Course" link at algs4.cs.princeton.edu. The course offers more than 100 video lecture segments that are integrated with the text, extensive online assessments, and the large-scale discussion forums that have proven so valuable. Offered each fall and spring, this course regularly attracts tens of thousands of registrants. Robert Sedgewick and Kevin Wayne are developing a modern approach to disseminating knowledge that fully embraces technology, enabling people all around the world to discover new ways of learning and teaching. By integrating their textbook, online content, and MOOC, all at the state of the art, they have built a unique resource that greatly expands the breadth and depth of the educational experience. The leading introduction to computer algorithms in use today, including fifty algorithms every programmer should know Princeton Computer Science professors, Robert Sedgewick and Kevin Wayne, survey the most important computer algorithms in use and of interest to anyone working in science, mathematics, and engineering, and those who use computation in the liberal arts. They provide a full treatment of data structures and algorithms for key areas that enable you to confidently implement, debug, and put them to work in any computational environment. Fundamentals: Basic programming models Data abstraction Bags, queues, and stacks Analysis of algorithms Sorting Elementary sorts Mergesort Quicksort Priority queues Applications Graphs Undirected graphs Directed graphs Minimum spanning trees Shortest paths Strings String sorts Tries Substring search Regular expressions Data compression These algorithms are generally ingenious creations that, remarkably, can each be expressed in just a dozen or two lines of code. As a group, they represent problem-solving power of amazing scope. They have enabled the construction of computational artifacts, the solution of scientific problems, and the development of commercial applications that would not have been feasible without them. Contents 7 Preface 9 1 Fundamentals 15 1.1 Basic Programming Model 21 1.2 Data Abstraction 77 1.3 Bags, Queues, and Stacks 133 1.4 Analysis of Algorithms 185 1.5 Case Study: Union-Find 229 2 Sorting 255 2.1 Elementary Sorts 257 2.2 Mergesort 283 2.3 Quicksort 301 2.4 Priority Queues 321 2.5 Applications 349 3 Searching 373 3.1 Symbol Tables 375 3.2 Binary Search Trees 409 3.3 Balanced Search Trees 437 3.4 Hash Tables 471 3.5 Applications 499 4 Graphs 527 4.1 Undirected Graphs 531 4.2 Directed Graphs 579 4.3 Minimum Spanning Trees 617 4.4 Shortest Paths 651 5 Strings 707 5.1 String Sorts 715 5.2 Tries 743 5.3 Substring Search 771 5.4 Regular Expressions 801 5.5 Data Compression 823 6 Context 865 Index 945 A 946 B 948 C 948 D 950 E 951 F 952 G 952 H 953 I 953 J 954 K 955 L 955 M 956 N 957 O 957 P 957 Q 960 R 960 S 961 T 964 U 964 V 965 W 965 Z 965 Algorithms 967 Clients 968 www.it-ebooks.info IT eBooks "This book surveys the most important computer algorithms in use today, to teach fundamental techniques to the growing number of people in need of knowing them. It is intended for use as a textbook for a second course in computer science, after students have acquired basic programming skills and familiarity with computer systems. The book also may be useful for self-study or as a reference for people engaged in the development of computer systems or applications programs, since it contains implementations of useful algorithms and detailed information on performance characteristics and clients."--Préface Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewick, s best-selling series, reflecting an indispensable body of knowledge developed over the past several decades. Broad Coverage Full treatment of data structures and algorithms for sorting, searching, graph processing, and string processing, including fifty algorithms every programmer should know