Home page of Holt Software Associates  | Home page of the Turing Programming Language, the fastest way to teach programming concepts  | Home page of Holt Software's Java products  | Home page of Ready to Program with Java(tm) Technology, a Java development environment designed for education  | Information about Holt Software's courses for teachers  | Information about how to contact Holt Software  | Information about how students can purchase Holt Software's books and software  | Information about how schools and bookstores can purchase Holt Software's books and software

Holt Software Books    [Graphical Version]  |  [Printer Friendly Version]

[Cover of Book]

Programming Data Structures in Java


Book Information

Title: Programming Data Structures in Java (First Edition)
Authors: J.N.P Hume, T.L. West, R.C. Holt and D.T. Barnard
ISBN: 0-921598-31-9
Publisher: Holt Software Associates Inc.
Binding: Softcover
Pages: 838 pgs
Price: Bookstores & Schools: $42.95    Retail: $53.95
Ordering Information: For bookstores and schools, click here for ordering information.
For individuals click here for ordering information.
Program Examples: Available [Click here for information on obtaining program examples found in Holt Software publications.]
Solutions Manual: Not Available

Book Description

This textbook has been designed to provide students with a solid understanding of data structures and algorithms using the Java programming language. Withing the context of a thoughtful consideration of issues such as object-oriented program design, development, validation and verification, it covers such topics such as stacks, sets, queues, recursion, trees, graphs and sorting. In recognition of Java's growing industrial relevance, the book also examines more advanced topics such as image loading, printing, animation and the Java 1.1 event model.

Each chapter provides further support for students with: example programs, illustrations, chapter summaries and exercises. All of the examples classes used in the textbook are also available on the web.


Preface to Programming Data Structures in Java (First Edition)

This textbook, Programming Data Structures in Java is intended to be used in a second course in computer science emphasizing data structures, abstract data types, and algorithms. While it uses object-oriented programming as a theme, this is only one theme among many that are covered. Other themes include software engineering, recursion, and efficiency.

Prerequisites

It is assumed that the student is knowledgeable about basic Java programming material covered in a first course in computer science. If the student is not familiar with Java, but has used another language such as Pascal or C, he or she should learn the basic language constructs of Java. These constructs are covered in Chapter 2.

Overview

This book covers the material in standard curricula for second courses in computer science. The listing of chapter titles outlines the arrangement of material.

The list of chapter titles outlines the arrangement of materials.

  1. Getting Started
  2. Basic Java Programming Constructs
  3. Java Class Libraries
  4. Searching Algorithms: Correctness and Efficiency
  5. Data Abstraction
  6. Stacks
  7. Sets
  8. Queues
  9. Priority Queues and Dictionaries
  10. Advanced Object-Oriented Concepts
  11. Recursion
  12. Trees
  13. Advanced Trees
  14. Graphs
  15. Sorting Algorithms
  16. Concurrency and Exceptions
  17. Advanced GUIs and Animation
Chapter 1 introduces recurring computer science themes and software engineering. Software engineering concepts are emphasized throughout the book.

Chapter 2 is mostly review for those who have already completed an introductory course using the Java programming language. It concentrates on Java language constructs and classes from the java.lang package.

Chapter 3 reviews many of the classes of the Java Class Libraries, in particular those used to implement graphical user interfaces in applets and Java applications. As well, use of the Graphics class is summarized.

Chapter 4 introduces fundamental material on searching algorithms and program correctness. Big O notation is also introduced. The algorithms covered are: order n and log n searches (serial and binary searches); as well as order n2 and n log n sorts (bubble and merge sorts).

Chapter 5 examines data structures and data abstraction. It provides a carefully developed abstract data type (an address book). This chapter emphasizes mechanisms and motivation for information hiding.

Chapter 6 through 9 use the ideas developed in Chapter 5 to introduce standard data abstractions, such as stacks, queues, and sets along with data structures to represent them. With most data abstractions, an extensive example of a typical usage is developed. For example, an expression evaluator uses the stack, and a bank simulation uses the queue. This approach is taken to ensure that the student understands an abstraction and its usual implementations, and also gains a good feel for the practical utility of the abstraction. The examples developed in these chapters typically consist of a number of reusable classes implementing the abstractions. These examples serve as case studies and allow further emphasis of software engineering ideas.

Chapter 10 concentrates on the higher concepts of object-oriented programming. These include abstract classes, class hierarchies, genericity, and Java interfaces. Object-oriented analysis is emphasized. The chapter also deals with the realities of programming in Java such as resource constraints and trade-offs between resource usage and program flexibility.

Chapter 11 gives standard examples of recursion and prepares the student for the use of recursion in manipulating data structures such as trees.

Chapter 12 introduces trees, their common implementations, and their common uses. This chapter uses a binary search tree example. Multiple implementations are examined along with their performance.

Chapter 13 contains advanced material on trees. It covers AVL trees in depth and examines multiple methods of tree traversal.

Chapter 14 introduces graphs with their basic algorithms, abstractions, and uses. This chapter begins with traversals of different implementations of graphs and continues to the implementation of a hypertext system.

Chapter 15 returns to the subject of sorting, and surveys basic sorting methods. These methods include: exchange sorts, heap sort, quicksort, merge sort, radix sort, and sorting with files.

Chapter 16 examines the issue of concurrency in general with examples such as producer-consumer programs and its use in Java-specific contexts such as lengthy responses to button presses. The second half of the chapter covers exceptions.

Chapter 17 provides additional detail for students wishing to write more complex Java applets and applications. It covers dialog boxes, loading images, using scrollbars, advanced animation using off-screen bitmaps, and printing.

Flexibility

Programming Data Structures in Java has been organized to allow it to be used flexibly to meet the requirements of the instructor. It is expected that the instructor may omit some chapters or parts of chapters, and may insert additional material.

This book provides only an introduction to program correctness, so the instructor may choose to add extra material on this subject. A good insertion point for this material is just after Chapter 4, or just after Chapter 11.

This book covers linked lists chapter by chapter, as the need for using the various kinds of linking arises. Chapters 2, 5, 6, 8, and 9 introduce linked lists with this organization:

2. Basic Programming Constructs
Java Classes for linked nodes.
5. Data Abstraction
Linearly linked lists, used to implement an address book.
6. Stacks
Linearly linked lists, used to implement a stack.
8. Queues
Linearly linked lists, used to implement a queue. Front and rear links for linked lists.
9. Priority Queues and Dictionaries
Linearly linked lists, used to implement a priority queue. Circularly linked lists, used to implement a dictionary. Doubly linked lists, used to implement a dictionary. Sentinel nodes in a linked list. Linearly linked lists, used to implement hashing buckets.

An instructor may prefer to present this material on linked lists as a unit. A good insertion point for this unit would be just after Chapter 3. Alternatively, a summary unit on this material would fit well at the end of Chapter 9.

Recursion is introduced as one of the basic programming constructs covered in Chapter 2. Chapter 6 covers the relationship between recursion and stacks. Chapter 11 concentrates on recursion. Chapters 12 and 13 make extensive use of recursion as it relates to trees. Instructors who wish to emphasize recursion may wish to introduce a unit on this subject. A good insertion point for this unit would be just before or after Chapter 6.

The Java Programming Language

Java is a programming language that was developed at Sun Microsystems. Java standalone application programs provide all the features of other general purpose languages such as Pascal or C. Java applets add the flexibility of sharing programs via the World Wide Web and Internet. Java is an object-oriented programming language and has been provided with an extensive library of classes that can be used in creating programs. This library is being rapidly extended by its many users.

The language is portable; it can be used on any computer platform that has a Java interpreter. This means that software developers can confidently program in Java and know that their software will run on any such computer. As well, individuals can also share applets via the Web. Attempts are made to make the use of shared programs safe. For security, for example, no applet may read from or write to a file on the system on which it is being executed.

Java syntax is based on the C syntax but many of the difficult and error prone parts of C and C++, such as pointers, operator overloading, and multiple inheritance have been eliminated. In this book we have eliminated still more of the "tricks" that some C programmers delight in. Our approach is based on the fundamental principle of structured programming, namely keeping programs easy to understand.

Java and its class libraries have many additional features which are not part of C or C++. It provides for strings, graphics, concurrency, and exception handling, as well as a large number of data structures in its class libraries. Java also provides graphical user interface classes.

All of these features contribute to Java's attractiveness as both a commercial software tool and a means of addressing the core computer science concepts.

Example Programs

All the programs in this book can be found in a file at the Holt Software web site at http://www.holtsoft.com/examples/data_structures_java_examples.zip. This file contains a "zipped" version of all the classes sorted by chapter and includes both the ".java" and ".class" files. See Appendix F for more details.

Contacts

Your comments, corrections, and suggestions are very welcome. Please feel free to contact us at:

Distribution Manager
Holt Software Associates Inc.
203 College Street, Suite 305
Toronto, Ontario, Canada M5T 1P9
E-mail: books@hsa.on.ca
USA or Canada phone: 1-800-361-8324
World Wide Web: http://www.holtsoft.com

Table of Contents of Programming Data Structures in Java

  • PREFACE
  • ACKNOWLEDGMENTS
  • Chapter 1 - GETTING STARTED
  • 1.1 Recurring Themes in Computer Science
  • 1.2 A Guided Tour of this Book
  • 1.3 Problems in Software Engineering
  • 1.4 Programming in the Large
  • 1.5 The Software Life Cycle
  • 1.6 Documentation
  • 1.7 Validation and Verification
  • 1.8 Testing
  • 1.9 Chapter Summary
  • Chapter 2 - BASIC JAVA PROGRAMMING CONSTRUCTS
  • 2.1 The Object-Oriented Paradigm
  • 2.2 Data Types, Assignments, and Expressions
  • 2.3 Standard Input and Output
  • 2.4 Input from and Output to a File
  • 2.5 The String Data Types
  • 2.6 Methods
  • 2.7 Arrays
  • 2.8 Control Constructs
  • 2.9 Classes for Records and Linked List Nodes
  • 2.10 Class Hierarchies
  • 2.11 Applications and Applets
  • 2.12 Chapter Summary
  • Chapter 3 - JAVA CLASS LIBRARIES
  • 3.1 The Applet Class
  • 3.2 Graphical User Interfaces (GUIs)
  • 3.3 Layout Managers
  • 3.4 GUIs with Java Applications
  • 3.5 The Font Class
  • 3.6 The Graphics Class
  • 3.7 Chapter Summary
  • 3.8 Exercises
  • Chapter 4 - SEARCHING ALGORITHMS: CORRECTNESS AND EFFICIENCY
  • 4.1 Specification Using Pre and Postconditions
  • 4.2 Implementing a Sequential Search
  • 4.3 Mathematical Induction
  • 4.4 Proving Program Correctness
  • 4.5 Binary Search
  • 4.6 Specifying a Sort Method
  • 4.7 Developing a Bubble Sort Method
  • 4.8 Running Time for Algorithms
  • 4.9 Chapter Summary
  • 4.10 Exercises
  • Chapter 5 - DATA ABSTRACTION
  • 5.1 Abstract Data Types
  • 5.2 Case Study: An Address Book as a Data Object
  • 5.3 Implementation of AddressBook Using an Array
  • 5.4 Implementation of AddressBook Using a Linked List
  • 5.5 Properties of Data Objects
  • 5.6 Chapter Summary
  • 5.7 Exercises
  • Chapter 6 - STACKS
  • 6.1 What is a Stack?
  • 6.2 A Stack as an Abstract Data Type
  • 6.3 Implementation of Stack Using an Array
  • 6.4 A Main Program that Uses a Stack
  • 6.5 Implementation of Stack Using a Linked List
  • 6.6 Checking for Balanced Parentheses
  • 6.7 Case Study: Using a Stack to Evaluate Arithmetic Expressions
  • 6.8 The Run Stack
  • 6.9 The Stack Class in the Java Class Library
  • 6.10 Chapter Summary
  • 6.11 Exercises
  • Chapter 7 - SETS
  • 7.1 Mathematical Definition of a Set
  • 7.2 Definition of ADT Set and Implementation as a Boolean Array
  • 7.3 The BitSet Class
  • 7.4 A Generic Set Class
  • 7.5 Chapter Summary
  • 7.6 Exercises
  • Chapter 8 - QUEUES
  • 8.1 What is a Queue?
  • 8.2 Defining a Queue as an Abstract Data Type
  • 8.3 Implementation of Queue Using an Array
  • 8.4 Implementation of Queue Using a Linked List
  • 8.5 Case Study: Simulating a Queue in a Bank
  • 8.6 Chapter Summary
  • 8.7 Exercises
  • Chapter 9 - PRIORITY QUEUES AND DICTIONARIES
  • 9.1 What is a Priority Queue?
  • 9.2 Defining a Priority Queue as an Abstract Data Type
  • 9.3 Implementation of PriorityQueue Using an Array
  • 9.4 Implementation of PriorityQueue Using a Linked List
  • 9.5 Example: Use of a Priority Queue to Schedule Repairs
  • 9.6 What is a Dictionary?
  • 9.7 Defining a Dictionary as an Abstract Data Type
  • 9.8 Implementation of Dictionary Using a Linked List
  • 9.9 Implementation of Dictionary Using Hashing
  • 9.10 Chapter Summary
  • 9.11 Exercises
  • Chapter 10 - ADVANCED OBJECT-ORIENTED CONCEPTS
  • 10.1 Separate Classes for Drawing Shapes
  • 10.2 An Abstract Shape Class as a Base Class
  • 10.3 Method Overloading in the Base Class
  • 10.4 Adding Methods to a Base Class
  • 10.5 Improving Efficiency of Extended Classes
  • 10.6 Class Hierarchies
  • 10.7 Java Interfaces
  • 10.8 Methods as Parameters in Java
  • 10.9 Genericity of Classes
  • 10.10 Chapter Summary
  • 10.11 Exercises
  • Chapter 11 - RECURSION
  • 11.1 Merge Magic
  • 11.2 The Nature of Recursion
  • 11.3 Recursive Algorithms for Linked Lists
  • 11.4 A Recursive Binary Search
  • 11.5 Iterative Versus Recursive Methods
  • 11.6 Backtracking with Recursion
  • 11.7 Chapter Summary
  • 11.8 Exercises
  • 11.9 Project
  • Chapter 12 - TREES
  • 12.1 What is a Tree?
  • 12.2 Tree Concepts
  • 12.3 Using Trees to Implement Abstract Data Types
  • 12.4 Binary Search Trees
  • 12.5 Implementation of Binary Search Tree
  • 12.6 Tree Operations
  • 12.7 Iterative Implementations
  • 12.8 What About Performance?
  • 12.9 Chapter Summary
  • 12.10 Exercises
  • Chapter 13 - ADVANCED TREES
  • 13.1 AVL Trees
  • 13.2 What About Performance?
  • 13.3 Complexity
  • 13.4 Tree Traversal
  • 13.5 Threaded Trees
  • 13.6 Chapter Summary
  • 13.7 Exercises
  • 13.8 Projects
  • Chapter 14 - GRAPHS
  • 14.1 What is a Graph?
  • 14.2 Defining a Graph as an Abstract Data Type
  • 14.3 Implementation of Graph Using an Adjacency Matrix
  • 14.4 Implementation of Graph Using Adjacency Lists
  • 14.5 Graph Traversal
  • 14.6 Spanning Trees
  • 14.7 Topological Ordering
  • 14.8 Case Study: Hypertext
  • 14.9 Chapter Summary
  • 14.10 Exercises
  • 14.11 Project
  • Chapter 15 - SORTING ALGORITHMS
  • 15.1 What is Sorting ?
  • 15.2 Simple Exchange Sorts
  • 15.3 Heap Sort
  • 15.4 Quicksort
  • 15.5 Merge Sort
  • 15.6 Radix Sort
  • 15.7 Sorting with Files
  • 15.8 Visualizing the Sorting Process
  • 15.9 Chapter Summary
  • 15.10 Exercises
  • Chapter 16 - CONCURRENCY AND EXCEPTIONS
  • 16.1 Concurrency and Threads of Execution
  • 16.2 The Thread Class
  • 16.3 Synchronized Methods
  • 16.4 Producer-Consumer Relationships
  • 16.5 The Runnable Interface
  • 16.6 Common Exceptions
  • 16.7 Dealing with Exceptions
  • 16.8 Chapter Summary
  • 16.9 Exercises
  • Chapter 17 - ADVANCED GUIS AND ANIMATION
  • 17.1 Dialog Boxes
  • 17.2 Images
  • 17.3 Scrollbars
  • 17.4 Animation without Flicker
  • 17.5 Printing
  • 17.6 Java 1.1 Event Handling
  • 17.7 Chapter Summary
  • 17.8 Exercises
  • APPENDICES
  • Appendix A : Reserved Words
  • Appendix B : Java Class Library
  • Classes Sorted by Package
  • Descriptions
  • Appendix C : Operators
  • Mathematical Operators
  • Boolean Operators
  • Bit Manipulation Operators
  • Operator Precedence
  • Appendix D : Applet Syntax
  • Appendix E : Application Syntax
  • Appendix F : Obtaining the Book Examples
  • Appendix G : Web Resources for Java
  • INDEX

  • [ Holt Software Home ] * [ Books (Graphical) ] * [ Books (Text) ] * [ Top of Page ] * [ Feedback ]