文档介绍:T
E
A
M
F
L
Y
Team-Fly®
The Tomes of Delphi™
Algorithms and Data
Structures
Julian Bucknall
Wordware Publishing, Inc.
Library of Congress Cataloging-in-Publication Data
Bucknall, Julian
Tomes of Delphi: algorithms and data structures / by Julian Bucknall.
p. cm.
Includes bibliographical references and index.
ISBN 1-55622-736-1 (pbk. : alk. paper)
1. Computer software—Development. 2. Delphi (Computer file). 3. Computer
algorithms. 4. Data structures (Computer science) I. Title.
.B825 2001 2001033258
--dc21 CIP
© 2001, Wordware Publishing, Inc.
Code © 2001, Julian Bucknall
All Rights Reserved
2320 Los Rios Boulevard
Plano, Texas 75074
No part of this book may be reproduced in any form or by
any means without permission in writing from
Wordware Publishing, Inc.
Printed in the United States of America
ISBN 1-55622-736-1
**********
0105
Delphi is a trademark of Inprise Corporation.
Other product names mentioned are used for identification purposes only and may be trademarks of their panies.
All inquiries for volume purchases of this book should be addressed to Wordware Publishing, Inc., at the
above address. Telephone inquiries may be made by calling:
(972) 423-0090
For Donna and the Greek cats
iii
Contents
Introduction .............................x
Chapter 1 What is an Algorithm? ........................1
What is an Algorithm? .........................1
Analysis of Algorithms ........................3
The Big-Oh Notation .........................6
Best, Average, and Worst Cases .................8
Algorithms and the Platform ......................8
Virtual Memory and Paging .....................9
Thrashing ...........................10
Locality of Reference .....................11
The CPU Cache ...........................12
Data Alignment ...........................12
Space Versus Time Tradeoffs ..................