11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1<strong>D<strong>at</strong>a</strong> <strong>Structures</strong> <strong>and</strong> <strong>Algorithm</strong>sHow many cities with more than 250,000 people lie within 500 miles of Dallas,Texas? How many people in my company make over $100,000 per year? Can weconnect all of our telephone customers with less than 1,000 miles of cable? Toanswer questions like these, it is not enough to have the necessary inform<strong>at</strong>ion. Wemust organize th<strong>at</strong> inform<strong>at</strong>ion in a way th<strong>at</strong> allows us to find the answers in timeto s<strong>at</strong>isfy our needs.Representing inform<strong>at</strong>ion is fundamental to computer science. The primarypurpose of most computer programs is not to perform calcul<strong>at</strong>ions, but to store <strong>and</strong>retrieve inform<strong>at</strong>ion — usually as fast as possible. For this reason, the study ofd<strong>at</strong>a structures <strong>and</strong> the algorithms th<strong>at</strong> manipul<strong>at</strong>e them is <strong>at</strong> the heart of computerscience. And th<strong>at</strong> is wh<strong>at</strong> this book is about — helping you to underst<strong>and</strong> how tostructure inform<strong>at</strong>ion to support efficient processing.This book has three primary goals. The first is to present the commonly usedd<strong>at</strong>a structures. These form a programmer’s basic d<strong>at</strong>a structure “toolkit.” Formany problems, some d<strong>at</strong>a structure in the toolkit provides a good solution.The second goal is to introduce the idea of tradeoffs <strong>and</strong> reinforce the conceptth<strong>at</strong> there are costs <strong>and</strong> benefits associ<strong>at</strong>ed with every d<strong>at</strong>a structure. This is doneby describing, for each d<strong>at</strong>a structure, the amount of space <strong>and</strong> time required fortypical oper<strong>at</strong>ions.The third goal is to teach how to measure the effectiveness of a d<strong>at</strong>a structure oralgorithm. Only through such measurement can you determine which d<strong>at</strong>a structurein your toolkit is most appropri<strong>at</strong>e for a new problem. The techniques presentedalso allow you to judge the merits of new d<strong>at</strong>a structures th<strong>at</strong> you or others mightinvent.There are often many approaches to solving a problem. How do we choosebetween them? At the heart of computer program design are two (sometimes conflicting)goals:1. To design an algorithm th<strong>at</strong> is easy to underst<strong>and</strong>, code, <strong>and</strong> debug.2. To design an algorithm th<strong>at</strong> makes efficient use of the computer’s resources.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!