DATA STRUCTURES with C Using STI Second Edition an ” ‘ = Poa - : a William Ford @ William Topp 100524900 Data Structures with C++ Using STL Data Structures with C++ Using STL William Ford University of the Pacific Computer Science Department William Topp University of the Pacific Computer Science Department Prentice Prentice Hall eC §=U©p per Saddle River, NJ 07458 es ie {oos +4100 QA Tb. (Be Library of Congress Cataloging-in-Publication Data Ford, William & Topp, William Crs Data structures with C+ + using STL / William Ford, William Topp p.cm. ay Includes index. ISBN 0-13-085850-1 1. C++ (Computer program language) 2. Data structures (Computer science) I. Title, William R., 1939 II. Title. QA76.73.C153 F675 2001 005.7’°3—dc21 2001032333 Vice President and Editorial Director, ECS: Marcia J. Horton Acquisitions Editor: Petra J. Recter Editorial Assistant: Karen Schultz Vice President and Director of Production and Manufacturing, ESM: David W. Riccardi Executive Managing Editor: Vince O’Brien Managing Editor: David A. George Production Editor: Audri Anna Bazlen Director of Creative Services: Paul Belfanti Creative Director: Carole Anson Art Director: Heather Scott Art Editor: Adam Velthaus Manufacturing Manager: Trudy Pisciotti Manufacturing Buyer: Lisa McDowell Marketing Manager: Jennie Burger Prentice © 2002 by Prentice Hall Hall Prentice-Hall, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and programs to determine their effective-ness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documenta- tion contained in this book. The author and publisher shall not be liable in any event for incidental or consequen- tial damages in connection with, or arising out of, the furnishing, performance, or use of these programs. Printed in the United States of America LOSS /o6 ISBN 0-13-085850-1 Prentice-Hall International (UK) Limited, London Prentice-Hall of Australia Pty. Limited, Sydney Prentice-Hall Canada Inc., Toronto Prentice-Hall Hispanoamericana, S.A., Mexico City Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo w~ Pearson Education Asia Pte. Ltd., Singapore Editora Prentice-Hall do Brasil, Ltda., Rio de Janeiro 4 To our wives, who provided love and understanding throughout the seemingly endless authoring process. To the designers and implementers of the Standard Template Library (STL), who unified the study of C++ data structures and allowed students to apply very powerful concepts to applications programming To our university, which gave us time, support, and resources. A) Marky cegatenut oneal hig wved teehee eit fessor, aevoiae VP) rene 1 olyOtiet tonlisa? oA oer wersal) Wvredée (iw 29" ah a so Dias 4 Pye es Se ye m expos: OU Nahe Y 7 shyt ai iy il) WA Tal WR \ 62 @ am eat. myees al . Lhe Heed te = a + piblieng tia mu ae hy: , = © oti eoq ay aiee Ty Leet agip@ 4 ‘ ‘ y od = ae ms ies aaa i-a ios y 4 tow ow Lo apeee a acy et ; _ . = ive § ehN isteaiealead . _ ~ os * S247IAas 7. a =. a +) Seige —— yy p= os Dae i) _