Data Structures and Algorithm Analysis in Java 3rd Edition Edition Mark A. Weiss instant download
Data Structures and Algorithm Analysis in Java 3rd Edition Edition Mark A. Weiss instant download
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-java-3rd-edition-edition-mark-a-weiss/
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-java-3rd-edition-dr-clifford-a-shaffer/
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-c-2nd-edition-china-reprint-edition-weiss/
https://ebookfinal.com/download/data-structures-in-java-a-laboratory-
course-1st-edition-sandra-andersen/
https://ebookfinal.com/download/data-structures-and-algorithms-in-
java-2nd-edition-adam-drozdek/
Data Analysis of Asymmetric Structures Advanced Approaches
in Computational Statistics 1st Edition Takayuki Saito
https://ebookfinal.com/download/data-analysis-of-asymmetric-
structures-advanced-approaches-in-computational-statistics-1st-
edition-takayuki-saito/
https://ebookfinal.com/download/classic-data-structures-samanta/
https://ebookfinal.com/download/a-guide-to-algorithm-design-paradigms-
methods-and-complexity-analysis-1st-edition-anne-benoit-author/
https://ebookfinal.com/download/solutions-manual-for-measurements-and-
data-analysis-3rd-edition-patrick-f-dunn/
Data Structures and Algorithm Analysis in Java 3rd
Edition Edition Mark A. Weiss Digital Instant Download
Author(s): Mark A. Weiss
ISBN(s): 9780132576277, 0132576279
Edition: 3rd Edition
File Details: PDF, 5.34 MB
Year: 2011
Language: english
This page intentionally left blank
Third Edition
Data
Structures
and Algorithm
Analysis in
JavaTM
TM
This page intentionally left blank
Third Edition
Data
Structures
and Algorithm
Analysis in
Java
TM
Mark A l l e n Weiss
Florida International University
PEARSON
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Editorial Director: Marcia Horton Project Manager: Pat Brown
Editor-in-Chief: Michael Hirsch Manufacturing Buyer: Pat Brown
Editorial Assistant: Emma Snider Art Director: Jayne Conte
Director of Marketing: Patrice Jones Cover Designer: Bruce Kenselaar
Marketing Manager: Yezan Alayan Cover Photo: c De-Kay Dreamstime.com
Marketing Coordinator: Kathryn Ferranti Media Editor: Daniel Sandin
Director of Production: Vince O’Brien Full-Service Project Management: Integra
Managing Editor: Jeff Holcomb Composition: Integra
Production Project Manager: Kayla Printer/Binder: Courier Westford
Smith-Tarbox Cover Printer: Lehigh-Phoenix Color/Hagerstown
Text Font: Berkeley-Book
Copyright c 2012, 2007, 1999 Pearson Education, Inc., publishing as Addison-Wesley. All rights reserved.
Printed in the United States of America. This publication is protected by Copyright, and permission should
be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or trans-
mission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain
permission(s) to use material from this work, please submit a written request to Pearson Education, Inc.,
Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your
request to 201-236-3290.
Many of the designations by manufacturers and sellers to distinguish their products are claimed as trade-
marks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the
designations have been printed in initial caps or all caps.
15 14 13 12 11—CRW—10 9 8 7 6 5 4 3 2 1
Preface xvii
Chapter 1 Introduction 1
1.1 What’s the Book About? 1
1.2 Mathematics Review 2
1.2.1 Exponents 3
1.2.2 Logarithms 3
1.2.3 Series 4
1.2.4 Modular Arithmetic 5
1.2.5 The P Word 6
1.3 A Brief Introduction to Recursion 8
1.4 Implementing Generic Components Pre-Java 5 12
1.4.1 Using Object for Genericity 13
1.4.2 Wrappers for Primitive Types 14
1.4.3 Using Interface Types for Genericity 14
1.4.4 Compatibility of Array Types 16
1.5 Implementing Generic Components Using Java 5 Generics 16
1.5.1 Simple Generic Classes and Interfaces 17
1.5.2 Autoboxing/Unboxing 18
1.5.3 The Diamond Operator 18
1.5.4 Wildcards with Bounds 19
1.5.5 Generic Static Methods 20
1.5.6 Type Bounds 21
1.5.7 Type Erasure 22
1.5.8 Restrictions on Generics 23
vii
viii Contents
Index 599
This page intentionally left blank
PREFACE
Purpose/Goals
This new Java edition describes data structures, methods of organizing large amounts of
data, and algorithm analysis, the estimation of the running time of algorithms. As computers
become faster and faster, the need for programs that can handle large amounts of input
becomes more acute. Paradoxically, this requires more careful attention to efficiency, since
inefficiencies in programs become most obvious when input sizes are large. By analyzing
an algorithm before it is actually coded, students can decide if a particular solution will be
feasible. For example, in this text students look at specific problems and see how careful
implementations can reduce the time constraint for large amounts of data from centuries
to less than a second. Therefore, no algorithm or data structure is presented without an
explanation of its running time. In some cases, minute details that affect the running time
of the implementation are explored.
Once a solution method is determined, a program must still be written. As computers
have become more powerful, the problems they must solve have become larger and more
complex, requiring development of more intricate programs. The goal of this text is to teach
students good programming and algorithm analysis skills simultaneously so that they can
develop such programs with the maximum amount of efficiency.
This book is suitable for either an advanced data structures (CS7) course or a first-year
graduate course in algorithm analysis. Students should have some knowledge of intermedi-
ate programming, including such topics as object-based programming and recursion, and
some background in discrete math.
r Chapter 8 uses the new union/find analysis by Seidel and Sharir, and shows the
O( Mα(M, N) ) bound instead of the weaker O( M log∗ N ) bound in prior editions.
r Chapter 12 adds material on suffix trees and suffix arrays, including the linear-time
suffix array construction algorithm by Karkkainen and Sanders (with implementation).
The sections covering deterministic skip lists and AA-trees have been removed.
r Throughout the text, the code has been updated to use the diamond operator from
Java 7.
Approach
Although the material in this text is largely language independent, programming requires
the use of a specific language. As the title implies, we have chosen Java for this book.
Java is often examined in comparison with C++. Java offers many benefits, and pro-
grammers often view Java as a safer, more portable, and easier-to-use language than C++.
As such, it makes a fine core language for discussing and implementing fundamental data
structures. Other important parts of Java, such as threads and its GUI, although important,
are not needed in this text and thus are not discussed.
Complete versions of the data structures, in both Java and C++, are available on
the Internet. We use similar coding conventions to make the parallels between the two
languages more evident.
Overview
Chapter 1 contains review material on discrete math and recursion. I believe the only way
to be comfortable with recursion is to see good uses over and over. Therefore, recursion
is prevalent in this text, with examples in every chapter except Chapter 5. Chapter 1 also
presents material that serves as a review of inheritance in Java. Included is a discussion of
Java generics.
Chapter 2 deals with algorithm analysis. This chapter explains asymptotic analysis and
its major weaknesses. Many examples are provided, including an in-depth explanation of
logarithmic running time. Simple recursive programs are analyzed by intuitively converting
them into iterative programs. More complicated divide-and-conquer programs are intro-
duced, but some of the analysis (solving recurrence relations) is implicitly delayed until
Chapter 7, where it is performed in detail.
Chapter 3 covers lists, stacks, and queues. This chapter has been significantly revised
from prior editions. It now includes a discussion of the Collections API ArrayList
and LinkedList classes, and it provides implementations of a significant subset of the
collections API ArrayList and LinkedList classes.
Chapter 4 covers trees, with an emphasis on search trees, including external search
trees (B-trees). The UNIX file system and expression trees are used as examples. AVL trees
and splay trees are introduced. More careful treatment of search tree implementation details
is found in Chapter 12. Additional coverage of trees, such as file compression and game
trees, is deferred until Chapter 10. Data structures for an external medium are considered
as the final topic in several chapters. New to this edition is a discussion of the Collections
API TreeSet and TreeMap classes, including a significant example that illustrates the use of
three separate maps to efficiently solve a problem.
Discovering Diverse Content Through
Random Scribd Documents
four ounces of powdered sugar. Break twelve fresh eggs, drop the
whites into a copper basin, and the yolks of five into the vessel
containing the sugar, reserving the other seven yolks for other
purposes. Add to the vessel containing the sugar and yolks a light
teaspoonful of vanilla essence: now with the wooden spatula, begin
to beat the yolks with the sugar as briskly as you possibly can for
fifteen minutes. Lay it aside. Then with the aid of a pastry wire-whip,
beat up to a very stiff froth the twelve egg whites in the copper
basin, which will take from twelve to fifteen minutes. Remove the
pastry wire-whip; take a skimmer in the right hand, and with the left
take hold of the vessel containing the preparation of the yolks and
sugar. Gradually pour it over the whites, and with the skimmer
gently mix the whole together for two minutes. The preparation will
now be of a light, firm consistency. Now, with the aid again of the
skimmer, take up the preparation and drop it down in the centre of
the cold dish, ready as above mentioned, taking special care to pile
it as high as possible, so as to have it of a perfect dome-shape; a
few incisions can be made all around, according to taste;
immediately place it in a moderate oven to bake for fifteen minutes.
Take it out of the oven, and, in order to avoid burning or soiling the
table-cloth, lay the dish containing the omelet on another cold one,
liberally sprinkle powdered sugar over it, and immediately send to
the table.
N. B.—Special care should be taken when piling the preparation
into the cold, silver dish; and the making of the incisions should be
done as rapidly as possible, so that success will be certain. When
desired, the vanilla essence can be substituted with the same
quantity of orange-flower water.
475. Sweet Omelet.—Beat and sweeten with one ounce of
sugar twelve eggs; make an omelet as for No. 450, using one ounce
of fresh butter; turn it on a dish, and dredge another ounce of sugar
over, then glaze it with a hot shovel or salamander, and serve very
warm.
476. Omelet au Kirsch, or Rum.—Make a sweet omelet with
twelve eggs as for the above (No. 475); when completed and
glazed, throw around it a glassful of kirsch, and set the omelet on
fire; serve it while burning. Rum omelet is prepared exactly the
same way, substituting rum for kirsch.
477. Omelet Célestine.—Pulverize six macaroons, put them in a
bowl, adding three tablespoonfuls of apple jelly (No. 1327) and one
spoonful of whipped cream (No. 1254); mix well with the spatula.
Make a sweet omelet as for No. 475, with twelve eggs; fold the
opposite side up, pour the mixture into the centre, fold the other
end up, turn it on a hot dish, and sprinkle the top with three
tablespoonfuls of powdered sugar; glaze the omelet with a hot
shovel or salamander, and decorate it with three lady-fingers (No.
1231) cut in two, also a cupful of whipped cream (No. 1254), the
latter poured into a paper-funnel, and piped over in any design the
fancy may dictate.
A pinch of salt represents 205 grains, or a tablespoonful.
Half a pinch of pepper represents 38 grains, or a teaspoonful.
A third of a pinch of nutmeg represents 13 grains, or half a
teaspoonful.
BEEF.
VEAL.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com