Data Structures With Java

by ;
Format: Hardcover
Pub. Date: 2004-01-01
Publisher(s): Prentice Hall
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $113.40

Rent Textbook

Select for Price
There was a problem. Please try again later.

New Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

For a freshman/sophomore-level course in Data Structures in Computer Science.This text teaches the use of direct source code implementations and the use of the Java libraries; it helps students prepare for later work on larger Java software solutions by adhering to software engineering principles and techniques such as the UML and the Java Collections Framework (JCF). Using the spiral approach to cover such topics as linked structures, recursion, and algorithm analysis, this text also provides revealing illustrations, summaries, review questions, and specialized reference sections.

Table of Contents

Object-Oriented Programming
1(36)
Problem Solving
1(4)
Object-Oriented Design
5(3)
Implementing the Software Design
8(3)
Testing the Class
11(3)
Implementing and Testing an Algorithm
14(2)
The Unified Modeling Language
16(2)
Inheritance, Aggregation, and Composition
18(4)
Mutable and Immutable Objects
22(15)
Chapter Summary
27(1)
Review Questions
28(1)
Exercises
29(1)
Programming Problems
30(1)
Projects
31(4)
Answers to Review Questions
35(2)
Abstract Data Types
37(36)
Concrete Data Types
37(1)
Abstraction
38(2)
Abstract Data Types
40(3)
Preconditions and Postconditions
43(2)
Using ADTs in Algorithms
45(1)
Concrete Data Types
46(4)
Implementing Preconditions and Postconditions
50(4)
Using the assert Statement
54(3)
Class Invariants
57(1)
Inheritance and Polymorphism
58(15)
Chapter Summary
61(1)
Review Questions
62(1)
Exercises
62(5)
Programming Problems
67(1)
Projects
67(3)
Answers to Review Questions
70(3)
Arrays
73(48)
Arrays in Java
73(4)
Printing an Array in Java
77(1)
Some Simple Array Algorithms
77(2)
Arrays of Objects
79(1)
The Sequential Search
80(1)
Complexity Analysis
81(3)
The Binary Search
84(2)
The java.util.Arrays Class
86(2)
A User-Defined IntArrays Class
88(2)
The java.util.Vector Class
90(4)
Multidimensional Arrays
94(4)
Case Study: Building a Concordance
98(23)
Chapter Summary
110(1)
Review Questions
111(1)
Exercises
111(3)
Programming Problems
114(5)
Projects
119(1)
Answers to Review Questions
120(1)
Linked Structures
121(30)
Maintaining an Ordered Array
121(2)
Indirect Reference
123(2)
Linked Nodes
125(8)
Inserting an Element into a Linked List
133(3)
Inserting at the Front of the List
136(2)
Deleting from a Sorted Linked List
138(1)
Nested Classes
139(2)
Case Study: Arbitrarily Long Integers
141(10)
Chapter Summary
146(1)
Review Questions
146(1)
Exercises
147(1)
Programming Problems
147(2)
Projects
149(1)
Answers to Review Questions
150(1)
Stacks
151(26)
The Stack ADT
151(2)
An Array Implementation
153(4)
Application: Evaluating Postfix Expressions
157(2)
Case Study: Solving a Maze
159(8)
A Linked Implementation
167(3)
The java.util.Stack Class
170(7)
Chapter Summary
171(1)
Review Questions
171(1)
Exercises
172(1)
Programming Problems
172(2)
Projects
174(1)
Answers to Review Questions
175(2)
Queues
177(22)
The Queue ADT
177(2)
Case Study: Capital Gains Valuation
179(2)
A Linked Implementation
181(3)
Case Study: Simulation with Queues
184(15)
Chapter Summary
195(1)
Review Questions
195(1)
Exercises
195(1)
Programming Problems
196(1)
Projects
197(1)
Answers to Review Questions
198(1)
Collections
199(34)
The Java Collections Framework
199(1)
A Simple Collection Interface
200(1)
Iterators
201(2)
An AbstractCollection Class
203(3)
An ArrayCollection Class
206(5)
A LinkedCollection Class
211(4)
The Complete java.util.Collection Interface
215(3)
The java.util.AbstractCollection Class
218(15)
Chapter Summary
221(1)
Review Questions
222(1)
Exercises
223(4)
Programming Problems
227(2)
Project
229(2)
Answers to Review Questions
231(2)
Lists
233(32)
List Classes in the Java Collections Framework
233(1)
Bidirectional List Iterators
234(6)
The java.util.List Interface
240(1)
Implementing the java.util.List Interface
241(8)
Linked Lists of Primitives and Specialized Objects
249(2)
Case Study: Polynomial Algebra
251(14)
Chapter Summary
260(1)
Review Questions
260(1)
Exercises
260(1)
Programming Problems
261(1)
Projects
262(1)
Answers to Review Questions
263(2)
Hash Tables
265(32)
Tables and Records
265(3)
An ADT for Maps
268(2)
Hash Tables
270(3)
Linear Probing
273(2)
Rehashing
275(3)
Other Collision Resolution Algorithms
278(3)
Separate Chaining
281(3)
The java.util.HashMap Class
284(2)
Analysis of Hashing Algorithms
286(1)
Perfect Hash Functions
287(3)
Other Hash Functions
290(7)
Chapter Summary
291(2)
Review Questions
293(1)
Exercises
293(2)
Programming Problems
295(1)
Projects
296(1)
Answers to Review Questions
296(1)
Recursion
297(32)
Recursive Functions
297(3)
The Towers of Hanoi
300(3)
Fibonacci Numbers
303(3)
Calling Trees
306(3)
Storing Instead of Recomputing
309(2)
De Moivre's Formula
311(2)
The Recursive Binary Search Algorithm
313(2)
Recursive Exponentiation
315(1)
Printing Permutations
315(3)
Indirect Recursion
318(11)
Chapter Review
321(1)
Review Questions
322(1)
Exercises
322(1)
Programming Problems
323(3)
Projects
326(2)
Answers to Review Questions
328(1)
Trees
329(24)
Trees
329(1)
Properties of Trees
330(6)
The Recursive Definition of a Tree
336(3)
Application: Decision Trees
339(2)
Ordered Trees
341(1)
Traversal Algorithms for Ordered Trees
342(2)
Complete Ordered Trees
344(9)
Chapter Summary
346(1)
Review Questions
347(1)
Exercises
347(3)
Programming Problems
350(1)
Project
350(1)
Answers to Review Questions
351(2)
Binary Trees
353(22)
Definitions
353(1)
Properties of Binary Trees
354(1)
Counting Binary Trees
355(2)
Binary Tree Traversal Algorithms
357(1)
Expression Trees
358(4)
Complete Binary Trees
362(2)
Forests
364(11)
Chapter Summary
365(1)
Review Questions
366(1)
Exercises
367(2)
Programming Problems
369(4)
Projects
373(1)
Answers to Review Questions
374(1)
Search Trees
375(40)
Keys and Comparable Types
375(2)
Binary Search Trees
377(3)
BST Deletion
380(3)
BST Performance
383(4)
AVL Trees
387(3)
Implementing AVL Trees
390(5)
Fibonacci Trees
395(2)
Multiway Search Trees
397(3)
B-Trees
400(3)
Red-Black Trees
403(12)
Chapter Summary
409(1)
Review Questions
409(1)
Exercises
410(1)
Programming Problems
411(1)
Projects
412(1)
Answers to Review Questions
412(3)
Heaps and Priority Queues
415(22)
Heaps
415(1)
Heap Algorithms
416(4)
Priority Queues
420(3)
A HeapPriorityQueue Class
423(3)
Case Study: Huffman Codes
426(11)
Chapter Summary
429(1)
Review Questions
430(1)
Exercises
430(3)
Programming Problems
433(1)
Projects
433(1)
Answers to Review Questions
434(3)
Sorting
437(42)
The Bubble Sort
438(4)
The Selection Sort
442(2)
The Insertion Sort
444(2)
The Shell Sort
446(3)
The Speed Limit for Comparison Sorts
449(1)
The Merge Sort
450(4)
The Quick Sort
454(4)
The Heap Sort
458(4)
The Bucket Sort
462(2)
The Counting Sort
464(2)
The Radix Sort
466(2)
The java.util.Arrays.sort() Method
468(11)
Chapter Summary
468(1)
Review Questions
469(1)
Exercises
469(6)
Programming Problems
475(2)
Projects
477(1)
Answers to Review Questions
478(1)
Graphs
479(28)
Graphs
479(3)
The Adjacency Matrix Implementation
482(2)
The Adjacency List Implementation
484(3)
Breadth-First Search
487(1)
Spanning Trees
488(3)
The Depth-First Search
491(1)
Weighted Graphs
492(2)
Dijkstra's Algorithm
494(5)
Digraphs
499(8)
Chapter Summary
500(1)
Review Questions
500(1)
Exercises
501(3)
Programming Problems
504(1)
Projects
505(1)
Answers to Review Questions
505(2)
Appendix A Answers and Hints
507(14)
Chapter 1 Exercises
507(2)
Chapter 2 Exercises
509(1)
Chapter 3 Projects
509(1)
Chapter 4 Programming Problems
510(1)
Chapter 5 Exercises
511(1)
Chapter 5 Programming Problems
512(1)
Chapter 6 Exercises
513(1)
Chapter 7 Programming Problems
514(1)
Chapter 8 Exercises
514(1)
Chapter 8 Programming Problem
515(1)
Chapter 9 Exercises
515(1)
Chapter 10 Exercises
515(1)
Chapter 10 Programming Problem
516(1)
Chapter 11 Exercises
516(1)
Chapter 12 Programming Problems
517(1)
Chapter 13 Exercises
518(1)
Chapter 14 Exercises
519(1)
Chapter 15 Exercises
519(1)
Chapter 16 Programming Problem
519(1)
Chapter 16 Exercises
520(1)
Appendix B Java Review
521(44)
Java Programs
521(1)
Compiling and Running a Java Program
522(6)
Java Types
528(2)
Classes and Members
530(3)
Access Modifiers
533(1)
The this Keyword
534(1)
Packages
535(4)
The Scope of a Class
539(1)
The new and instanceof Operators
540(1)
Using Command Line Arguments
541(3)
Wrapper Classes
544(1)
Exception Handling
545(3)
Java I/O
548(5)
Interactive Input
553(1)
Initialization
554(2)
Interfaces
556(2)
Types and Polymorphism
558(1)
Abstract Methods and Abstract Classes
558(2)
From C++ to Java
560(5)
Appendix Review
562(1)
Review Questions
562(1)
Programming Problems
563(1)
Answers to Review Questions
563(2)
Appendix C Essential Mathematics
565(22)
The Floor and Ceiling Functions
565(1)
Logarithms
566(1)
Asymptotic Complexity Classes
567(2)
The First Principle of Mathematical Induction
569(1)
The Second Principle of Mathematical Induction
570(1)
Geometric Series
571(1)
Other Summation Formulas
572(1)
Harmonic Numbers
573(2)
Stirling's Formula
575(1)
Fibonacci Numbers
576(2)
Binomial Coefficients
578(1)
Catalan Numbers
579(8)
Review Questions
584(1)
Exercises
584(2)
Programming Problems
586(1)
Answers to Review Questions
586(1)
Appendix D The Java Collections Frameworks
587(12)
The Inheritance Hierarchy
587(1)
The Collection Interface
588(2)
The List Classes
590(2)
The Set Classes
592(1)
The Map Classes
593(6)
Appendix E References
599(4)
Books
599(2)
Papers
601(1)
URLs
601(2)
Index 603

Excerpts

This book is intended to be used as a textbook for a university course in data structures, the standard CS2 course offered in American universities. It assumes that the student has completed an elementary course in computer programming with Java. A summary of Java fundamentals is provided in Appendix B for students who need to review the language. The book covers all the classical data structures topics: basic concepts in Chapters 1-3, linear data structures (stacks, queues, lists, and tables) in Chapters 4-9, nonlinear data structures (trees and graphs) in Chapters 10-14 and 16, and a substantial treatment of ten sorting algorithms in Chapter 15. It is flexible enough to be used either for a one-semester course in data structures or for a two-semester course in data structures and algorithms. Algorithms are presented explicitly throughout the book. They are introduced in Section 1.5 at a simple level and then studied at progressively deeper levels in later chapters. Complexity analysis is introduced in Section 3.6 and then applied later in chapters 9-16. Loop invariants are finally introduced in Chapter 15 to establish the correctness of the sorting algorithms. Some of these advanced topics can easily be omitted in a one-semester CS2 course. The chart on the next page shows the chapter dependencies. It shows that the book is flexible enough to support a reordering of some topics. For example, recursion could be done near the beginning of the course, and hash tables could be done at the end of the course. We use the spiral approach on difficult topics. For example, linked structures are introduced in Chapter 4 as a variant of indirect arrays, and then gradually developed through Chapters 5-8. The book emphasizes the important distinction between abstract data types (ADTs) and their underlying data structures. ADTs are represented by UML diagrams and realized as Java interfaces. Specific data structures, such as arrays and linked lists, are seen as backing structures for alternative implementations of a given ADT. This important separation of design from implementation is embodied throughout the Java Collections Framework (JCF), which is thoroughly covered in Chapter 7 and Appendix D. Not only does the JCF clarify the value of abstraction, but it also provides the student with many exemplary programming strategies. Although this is a textbook about data structures, the authors are well aware that students in this course are still learning fundamental programming concepts and Java techniques. Accordingly, we have included many examples and explanations of topics such as polymorphism, simulation, abstract classes, inner classes, and reflection. We are firm believers in the old adage, "A picture is worth 1024 words:" So you will find extensive illustrations throughout the book. It contains over 350 figures. It could be subtitled "Visual Data Structures:" We have also tried to make the book as current as possible. It uses Java 1.4, including new features such as the assert statement in Chapter 2 and the new LinkedHash classes in Appendix D. It also uses Unified Modeling Language (UML) diagrams to summarize class definitions and their relationships. The companion website for this book is: www.prenhall.com/hubbard/ It contains an on-line study guide and Java source code for all the examples in the book. An Instructor's Resource CD is also available. It contains Power Point slides, a test bank for ~ chapter, and solutions to all the exercises and programming problems in the book. We are grateful for the assistance we have received on this work from our friends at Prentice-Hall and at the University of Richmond. In particular, we wish to thank Matthew Albin, Rom n, Natalie Goldberg, Dan Katz, Andrew Lobo, and Molly McCann at Richmond, and 'Lelcshmi Balasubramanian, Petra Recter, and Camille Trentacoste at

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.