Cover image for Object-oriented data structures using Java
Title:
Object-oriented data structures using Java
Personal Author:
Edition:
2nd ed.
Publication Information:
Sudbury, Mass. : Jones and Bartlett, 2006.
Physical Description:
xx, 779 p. : ill. ; 24 cm.
ISBN:
9780763737467
General Note:
Includes index.

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010249859 QA76.64 D35 2006 Open Access Book Book
Searching...

On Order

Summary

Summary

Thoroughly revised and updated, Object Oriented Data Structures using Java, Second Edition presents classic data structure topics with an emphasis on problem solving, theory, and software engineering principles. Beginning early and continuing throughout the text, the authors carefully introduce and expand on the use of many Java features such as packages, interfaces, abstract classes, inheritance, and exceptions. Chapters have been rearranged to get to the heart of the textbook material more quickly and additional exercises and example applications are included throughout.


Table of Contents

1 Getting Organizedp. 1
1.1 Software Engineeringp. 2
Software Life Cyclesp. 3
Agile Methodsp. 5
Goals of Quality Softwarep. 6
1.2 Object Orientationp. 8
Benefitsp. 9
The Unified Methodp. 9
1.3 Classes, Objects, and Applicationsp. 10
Classesp. 10
Objectsp. 16
Applicationsp. 18
1.4 Organizing Classesp. 20
Inheritancep. 21
Packagesp. 26
1.5 Data Structuresp. 28
Implementation-Dependent Structuresp. 29
Implementation-Independent Structuresp. 30
What Is a Data Structure?p. 33
1.6 Basic Structuring Mechanismsp. 33
Referencesp. 33
Arraysp. 37
1.7 Comparing Algorithms: Big-O Analysisp. 41
Big-O Notationp. 44
Common Orders of Magnitudep. 46
Example 1 Sum of Consecutive Integersp. 47
Example 2 Finding a Number in a Phone Bookp. 49
Summaryp. 51
Exercisesp. 52
2 Abstract Data Typesp. 61
2.1 Abstractionp. 62
Information Hidingp. 62
Data Abstractionp. 63
Data Levelsp. 64
Preconditions and Postconditionsp. 65
Java Interfacesp. 66
2.2 The StringLog ADT Specificationp. 70
Constructorsp. 70
Transformersp. 71
Observersp. 71
The StringLogInterfacep. 71
Using the StringLogInterfacep. 73
2.3 Array-Based StringLog ADT Implementationp. 75
Instance Variablesp. 75
Constructorsp. 77
Transformersp. 78
Observersp. 80
2.4 Software Testingp. 89
Identifying Test Casesp. 90
Test Plansp. 92
Testing ADT Implementationsp. 92
2.5 Introduction to Linked Listsp. 100
Array versus Linked Listsp. 100
The LLStringNode Classp. 101
Operations on Linked Listsp. 105
2.6 Linked List StringLog ADT Implementationp. 111
Instance Variablesp. 113
Constructorsp. 113
Transformersp. 114
Observersp. 117
2.7 Software Design: Identification of Classesp. 122
Brainstormp. 122
Filterp. 123
Scenario Analysisp. 123
Nouns and Verbsp. 123
Cohesive Designsp. 124
Summation of Our Approachp. 124
Design Choicesp. 126
2.8 Case Study: A Trivia Gamep. 126
The Source of the Trivia Gamep. 127
Identifying Support Classesp. 129
Implementing the Support Classesp. 131
The Trivia Game Applicationp. 138
Case Study Summationp. 143
Summaryp. 144
Exercisesp. 144
3 The Stack ADTp. 155
3.1 Stacksp. 156
Operations on Stacksp. 157
Using Stacksp. 157
3.2 Collection Elementsp. 159
Generally Usable Collectionsp. 160
3.3 Exceptional Situationsp. 163
Handling Exceptional Situationsp. 163
Exceptions and ADTs: An Examplep. 164
Error Situations and ADTsp. 169
3.4 Formal Specificationp. 171
Exceptional Situationsp. 172
The Interfacesp. 175
3.5 Application: Well-Formed Expressionsp. 179
The Balanced Classp. 180
The Applicationp. 185
3.6 Array-Based Implementationsp. 188
The ArrayStack Classp. 188
Definitions of Stack Operationsp. 190
Test Planp. 192
3.7 Link-Based Implementationp. 195
The LLObject Node Classp. 196
The LinkedStack Classp. 197
The push Operationp. 198
The pop Operationp. 202
The Other Stack Operationsp. 204
Comparing Stack Implementationsp. 206
3.8 Case Study: Postfix Expression Evaluatorp. 207
Discussionp. 207
Evaluating Postfix Expressionsp. 208
Postfix Expression Evaluation Algorithmp. 210
Specification: Program Postfix Evaluationp. 212
Brainstorming and Filteringp. 214
The PostFixEvaluator Classp. 215
The PFixConsole Classp. 218
Testing the Postfix Evaluatorp. 220
Summaryp. 222
Exercisesp. 222
4 A Recursionp. 235
4.1 Recursive Definitions, Algorithms, and Programsp. 236
Recursive Definitionsp. 236
Recursive Algorithmsp. 237
Recursive Programsp. 240
4.2 The Three Questionsp. 243
Verifying Recursive Algorithmsp. 243
Writing Recursive Methodsp. 245
Debugging Recursive Methodsp. 245
4.3 Towers of Hanoip. 246
The Algorithmp. 246
The Methodp. 248
The Programp. 249
4.4 Counting Blobsp. 252
Generating Blobsp. 253
The Counting Algorithmp. 254
The Marking Algorithmp. 255
The Grid Classp. 256
The Programp. 259
4.5 Recursive Linked-List Processingp. 261
Reverse Printingp. 261
4.6 Removing Recursionp. 265
How Recursion Worksp. 266
Iterationp. 270
Stackingp. 271
4.7 Deciding Whether to Use a Recursive Solutionp. 273
Recursion Overheadp. 274
Inefficient Algorithmsp. 274
Clarityp. 277
Summaryp. 277
Exercisesp. 278
5 The Queue ADTp. 289
5.1 Queuesp. 290
Operations on the Queuesp. 291
Using Queuesp. 291
5.2 Formal Specificationp. 292
5.3 Application: Palindromesp. 296
The Palindrome Classp. 296
The Applicationp. 299
5.4 Array-Based Implementationsp. 301
The ArrayBndQueue Classp. 301
The ArrayUnbndQueue Classp. 308
5.5 Application: The Card Game of Warp. 311
The RankCardDeck Classp. 312
The WarGame Classp. 313
The WarGameApp Classp. 318
5.6 Link-Based Implementationsp. 321
The Enqueue Operationp. 323
The Dequeue Operationp. 324
The Queue Implementationp. 326
A Circular Linked Queue Designp. 327
Comparing Queue Implementationsp. 328
5.7 Case Study: Average Waiting Timep. 330
Problem Discussionp. 331
Program Designp. 333
Program Detailsp. 336
Testing Considerationsp. 346
Summaryp. 347
Exercisesp. 349
6 The List ADTp. 357
6.1 Comparing Objects Revisitedp. 358
The equals Methodp. 358
The Comparable Interfacep. 360
6.2 Listsp. 362
Varieties of Listsp. 363
Assumptions for Our Listsp. 364
6.3 Formal Specificationp. 364
The ListInterfacep. 364
The Specialized Interfacesp. 367
Example Usep. 370
6.4 Array-Based Implementationsp. 373
The List Classp. 374
The ArrayUnsortedList Classp. 379
The ArraySortedList Classp. 382
The ArrayIndexedList Classp. 389
6.5 Applications: Poker, Golf, and Musicp. 393
Pokerp. 394
Golfp. 397
Musicp. 400
6.6 The Binary Search Algorithmp. 404
Improving Linear Search in a Sorted Listp. 405
Binary Search Algorithmp. 405
Recursive Binary Searchp. 410
Efficiency Analysisp. 413
6.7 Reference-Based Implementationsp. 414
The RefList Classp. 414
The RefUnsortedList Classp. 421
The RefSortedList Classp. 422
6.8 Storing Objects and Structures in Filesp. 427
Saving Object Data in Text Filesp. 428
Serialization of Objectsp. 429
Serializing Structuresp. 433
Application: Song Listsp. 433
Summaryp. 441
Exercisesp. 441
7 More Listsp. 455
7.1 Circular Linked Listsp. 456
An Unsorted Circular Listp. 457
The CrefList Classp. 459
The CrefUnsorted List Classp. 464
Circular versus Linear Linked Listsp. 465
7.2 Doubly Linked Listsp. 466
The Add and Remove Operationsp. 468
7.3 Linked Lists with Headers and Trailersp. 470
7.4 A Linked List as an Array of Nodesp. 471
Why Use an Array?p. 472
How Is an Array Used?p. 472
7.5 A Specialized List ADTp. 480
The Specificationp. 481
The Implementationp. 482
7.6 Case Study: Large Integersp. 487
The LargeInt Classp. 491
Addition and Subtractionp. 493
Test Planp. 501
The LargeIntApp Programp. 502
Summaryp. 506
Exercisesp. 506
8 Binary Search Treesp. 515
8.1 Treesp. 516
Binary Treesp. 518
Binary Search Treesp. 520
Binary Tree Traversalsp. 522
8.2 The Logical Levelp. 524
Tree Elementsp. 524
The Binary Search Tree Specificationp. 525
8.3 The Application Levelp. 527
8.4 The Implementation Level: Basicsp. 529
8.5 Iterative versus Recursive Method Implementationsp. 532
Recursive Approach to the size Methodp. 533
Iterative Approach to the size Methodp. 537
Recursion or Iteration?p. 539
8.6 The Implementation Level: Remaining Operationsp. 539
The contains and get Operationsp. 539
The add Operationp. 543
The remove Operationp. 548
Iterationp. 555
Testing Binary Search Tree Operationsp. 559
8.7 Comparing Binary Search Tree and Linear Listsp. 561
Big-O Comparisonsp. 561
8.8 Balancing a Binary Search Treep. 562
8.9 A Nonlinked Representation of Binary Treesp. 568
8.10 Case Study: Word Frequency Generatorp. 572
Problemp. 572
Discussionp. 572
Brainstormingp. 572
Filteringp. 573
The User Interfacep. 573
Error Handlingp. 574
Scenario Analysisp. 574
The WordFreq Classp. 576
The Word Frequency Generator Programp. 578
Testingp. 580
Summaryp. 582
Exercisesp. 582
9 Priority Queues, Heaps, and Graphsp. 597
9.1 Priority Queuesp. 598
Logical Levelp. 598
Application Levelp. 600
Implementation Levelp. 600
9.2 Heapsp. 601
Heap Implementationp. 605
The enqueue Methodp. 607
The dequeue Methodp. 610
Heaps versus Other Representations of Priority Queuesp. 614
9.3 Introduction to Graphsp. 615
9.4 Formal Specification of a Graph ADTp. 620
9.5 Graph Applicationsp. 622
Depth-First Searchingp. 622
Breadth-First Searchingp. 626
The Single-Source Shortest-Paths Problemp. 629
9.6 Implementations of Graphsp. 635
Array-Based Implementationp. 635
Linked Implementationp. 640
Summaryp. 642
Exercisesp. 643
10 Sorting and Searching Algorithmsp. 653
10.1 Sortingp. 654
A Test Harnessp. 655
10.2 Simple Sortsp. 658
Straight Selection Sortp. 658
Bubble Sortp. 664
Insertion Sortp. 668
10.3 O(N log[subscript 2]N) Sortsp. 672
Merge Sortp. 672
Quick Sortp. 680
Heap Sortp. 686
10.4 More Sorting Considerationsp. 692
Testingp. 692
Efficiencyp. 692
Objects and Referencesp. 694
Using the Comparable Interfacep. 694
Using the Comparator Interfacep. 695
Stabilityp. 701
10.5 Searchingp. 702
Linear Searchingp. 702
High Probability Orderingp. 703
Sorted Listsp. 704
10.6 Hashingp. 704
Collisionsp. 707
Choosing a Good Hash Functionp. 716
Complexityp. 719
Summaryp. 719
Exercisesp. 720
Appendix A Java Reserved Wordsp. 729
Appendix B Operator Precedencep. 730
Appendix C Primitive Data Typesp. 731
Appendix D ASCII Subset of Unicodep. 732
Appendix E Application of Programmer Interfaces for the Java Classes and Interfaces Used in This Bookp. 733
Appendix F A Generic Stackp. 749
F.1 The Bounded Stack Interfacep. 750
F.2 The Bounded Stack Classp. 751
F.3 The SampleApp Classp. 754
Indexp. 757