Example: bachelor of science

Algorithms, Fourth Edition - BU

AlgorithmsFOURTH EDITIONThis page intentionally left blank AlgorithmsRobert SedgewickandKevin WaynePrinceton UniversityFOURTH EDITIONU pper Saddle River, NJ Boston Indianapolis San FranciscoNew York Toronto Montreal London Munich Paris MadridCapetown Sydney Tokyo Singapore Mexico CityMany of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

current Algorithms in C/C++/Java, Third Edition is more appropriate as a reference or a text for an advanced course; this book is specifically designed to be a textbook for a one-semester course for first- or second-year college students and as a modern introduction to the basics and a reference for use by working programmers.

Tags:

  Edition

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Algorithms, Fourth Edition - BU

1 AlgorithmsFOURTH EDITIONThis page intentionally left blank AlgorithmsRobert SedgewickandKevin WaynePrinceton UniversityFOURTH EDITIONU pper Saddle River, NJ Boston Indianapolis San FranciscoNew York Toronto Montreal London Munich Paris MadridCapetown Sydney Tokyo Singapore Mexico CityMany of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

2 The authors and publisher have taken care in the preparation of this book, but make no expressed or im-plied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests.

3 For more information, please Corporate and Government Sales(800) sales outside the United States, please contact:International us on the Web: Cataloging-in-Publication Data is on file with the Library of 2011 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

4 For information regarding permissions, write to: Pearson Education, and Contracts Department501 Boylston Street, Suite 900 Boston, MA 02116 Fax: (617) 671-3447 ISBN-13: 978-0-321-57351-3 ISBN-10: 0-321-57351-XTe x t p r i n t e d i n t h e U n i t e d S t a t e s o n r e c y c l e d p a p e r a t C o u r i e r i n We s t f o r d , M a s s a c h u s e t t s .First printing, March 2011_____To A d a m , An d r e w, B r e t t , Ro b b i eand especially Linda_____To Ja c k i e a n d A l e x_____viPreface .. viii1 Fundamentals.

5 Basic Programming Model Data Abstraction Bags, Queues, and Stacks Analysis of Algorithms Case Study: Union-Find 2162 Sorting .. Elementary Sorts Mergesort Quicksort Priority Queues Applications 3363 Searching .. Symbol Tables Binary Search Trees Balanced Search Trees Hash Tables Applications 486 CONTENTSvii4 Graphs .. Undirected Graphs Directed Graphs Minimum Spanning Trees Shortest Paths 6385 Strings .. String Sorts Tries Substring Search Regular Expressions Data Compression 8106 Context.

6 853 Index .. 933 Algorithms .. 954 Clients .. 955viiiThis book is intended to survey the most important computer algorithms in use today, and 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 implemen-tations of useful algorithms and detailed information on performance characteristics and clients.

7 The broad perspective taken makes the book an appropriate introduction to the study of algorithms and data structures is fundamental to any computer-science curriculum, but it is not just for programmers and computer-science students. Every-one who uses a computer wants it to run faster or to solve larger problems. The algorithms in this book represent a body of knowledge developed over the last 50 years that has become indispensable. From N-body simulation problems in physics to genetic-sequencing problems in molecular biology, the basic methods described here have become essential in scientific research; from architectural modeling systems to aircraft simulation, they have become es-sential tools in engineering; and from database systems to internet search engines, they have become essential parts of modern software systems.

8 And these are but a few examples as the scope of computer applications continues to grow, so grows the impact of the basic methods covered developing our fundamental approach to studying algorithms, we develop data types for stacks, queues, and other low-level abstractions that we use throughout the book. Then we survey fundamental algorithms for sorting, searching, graphs, and strings. The last chapter is an overview placing the rest of the material in the book in a larger features The orientation of the book is to study algorithms likely to be of practical use.

9 The book teaches a broad variety of algorithms and data structures and pro-vides sufficient information about them that readers can confidently implement, debug, and put them to work in any computational environment. The approach involves:Algorithms. Our descriptions of algorithms are based on complete implementations and on a discussion of the operations of these programs on a consistent set of examples. Instead of presenting pseudo-code, we work with real code, so that the programs can quickly be put to practical use. Our programs are written in Java, but in a style such that most of our code can be reused to develop implementations in other modern programming types.

10 We u s e a m o d e r n p r o g r a m m i n g s t y l e b a s e d o n d a t a a b s t r a c t i o n , s o t h a t a l g o-rithms and their data structures are encapsulated Each chapter has a detailed description of applications where the algorithms described play a critical role. These range from applications in physics and molecular biology, to engineering computers and systems, to familiar tasks such as data compression and search-ing on the scientific approach. We e m p h a s i z e d e v e l o p i n g m a t h e m a t i c a l m o d e l s f o r d e s c r i b i n g t h e performance of algorithms, using the models to develop hypotheses about performance, and then testing the hypotheses by running the algorithms in realistic of coverage.


Related search queries