文档介绍:Algorithms in C
Robert Sedgewick
Princeton University
"..." ADDISON·WESLEY PANY
Reading, Massachusetts. Menlo Park, California. New York
Don Mills, Ontario • Wokingham, England • Amsterdam • Bonn • Sydney • Singapore
Tokyo. Madrid. San Juan
Keith Wollman: Sponsoring Editor
Karen Myer: Production Supervisor
Roy Logan: Manufacturing Supervisor
Patsy DuMoulin: Production Coordinator
Linda Sedgewick: Cover Art
This book is in the Addison-Wesley Series puter Science
Michael A. Harrison: Consulting Editor
The programs and applications presented in this book have been included for their
instructional value. They have been tested with care, but are not guaranteed for any
particular purpose. The publisher does not offer any warranties or representations,
nor does it accept any liabilities with respect to the prog;rams or applications.
Library of Congress Cataloging-in-Publication Data
Sedgewick, Robert, 1946 -
Algorithms in C j by Robert Sedgewick.
p. em.
Includes bibliographies and index
ISBN 0-201-51425-7
1. C (Computer program language) 2. Algorithms. I. Title.
1990
'3 - dc20 89-37096
CIP
Reproduced by Addison-Wesley from camera-ready copy supplied by the author.
Reprinted with corrections December, 1990
Copyright © 1990 by Addison-Wesley pany, Inc.
All rights reserved. No part of this publication may be reproduced, stored in a
retrieval system, or transmitted, in any form or by any means, electronic, mechan•
ical, photocopying, recording, or otherwise, without the prior written permission
of the publisher. Printed in the United States of America.
7 8 9 10 HA 95949392
To Adam, Andrew, Brett, Robbie
and especially Linda
Preface
This book is intended to survey the most puter algorithms in use
today and to teach fundamental techniques to the growing number of people in need
of knowing them. It can be used as a textbook for a second, third, or fourth course
puter science, after students have acquired