Home > Store

Data Structures and Problem Solving Using Java

Register your product to gain access to bonus material or receive a coupon.

Data Structures and Problem Solving Using Java

Premium Website

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Takes a unique approach by separating the interface of a data structure (Part 2) from their implementations (Part 4), to motivate abstract thinking and problem solving. Students use the data structures in Part 3 (Applications).
  • Contains extensive sample code using Java 1.1, which is available over the Internet and has been tested and reviewed by a professional programmer for accuracy. (Code approved by Sun.)
  • Contains advanced data structures in Part 5.

Description

  • Copyright 1998
  • Edition: 1st
  • Premium Website
  • ISBN-10: 0-201-54991-3
  • ISBN-13: 978-0-201-54991-1

Data Structures and Problem Solving Using Java teaches data structures and algorithms from the perspective of abstract thinking and problem solving. In this text, experienced author and educator Mark Allen Weiss takes a unique approach by clearly separating the specification and implementation of data structures. Dr. Weiss presents the interface and running time of data structures in Part II of the book. Then, he provides the opportunity for students to use the data structures in a variety of practical examples before introducing the implementations in Part IV. By first gaining a familiarity with the interfaces and uses of data structures, readers will be able to think more abstractly about the subject matter.

Features
  • Contains extensive sample code using Java 1.1, which is available over the Internet and has been tested and reviewed by a professional programmer for accuracy.
  • Provides an introduction to Java in Part I and also covers Graphical User Interfaces (GUI's) in an appendix.
  • Includes pedagogical aids such as margin notes and comprehensive end-of-chapter material to help readers grasp challenging concepts.
  • Offers flexibility in topic coverage by minimizing dependencies among the different chapters.


0201549913B04062001

Downloads

Source Code

Click below for Source Code related to this title:
Source Code

Extras

Web Resources

Click below for Web Resources related to this title:
Author's Web Site

Sample Content

Table of Contents

I. TOUR OF JAVA.

1. Primitive Java.
The General Environment.
The First Program.
Comments.
main.
Terminal Output.
Primitive Types.
The Primitive Types.
Constants.
Declaration and Initialization of Primitive Types.
Terminal Input and Output.
Basic Operators.
Assignment Operators.
Binary Arithmetic Operators.
Unary Operators.
Type Conversions.
Conditional Statements.
Relational and Equality Operators.
Logical Operators.
The if Statement.
The while Statement.
The for Statement.
The do Statement.
break and continue.
The switch Statement.
The Conditional Operator.
Methods.
Overloading of Method Names.
Storage Classes.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

2. References.
What Is a Reference?
Basics of Objects and References.
The Dot Operator (.).
Declaration of Objects.
Garbage Collection.
The Meaning of =.
Parameter Passing.
The Meaning of ==.
Operator Overloading for Objects.
Strings.
Basics of String Manipulation.
String Concatenation.
Comparing Strings.
Other String Methods.
Converting between Strings and Primitive Types.
Arrays.
Declaration, Assignment, and Methods.
Dynamic Array Expansion.
Multidimensional Arrays.
Command-line Arguments.
Exception Handling.
Processing Exceptions.
The finally Clause.
Common Exceptions.
The throw and throws Clauses.
Input and Output.
Basic Stream Operations.
The StringTokenizer Object.
Sequential Files.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

3. Objects and Classes.
What Is Object-oriented Programming?
A Simple Example.
Javadoc.
Basic Methods.
Constructors.
Mutators and Accessors.
Output and toString.
equals.
static Methods.
main.
Packages.
The import Directive.
The package Statement.
The CLASSPATH Environment Variable.
Package-friendly Visibility Rules.
Separate Compilation.
Additional Constructs.
The this Reference.
The this Shorthand for Constructors.
The instanceof Operator.
Static Fields.
Static Initializers.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

4. Inheritance.
What Is Inheritance?
Basic Java Syntax.
Visibility Rules.
The Constructor and super.
final Methods and Classes.
Overriding a Method.
Abstract Methods and Classes.
Example: Expanding the Shape Class.
Digression: An Introduction to Sorting.
Multiple Inheritance.
The Interface.
Specifying an Interface.
Implementing an Interface.
Multiple Interfaces.
Implementing Generic Components.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

II. ALGORITHMS AND BUILDING BLOCKS.

5. Algorithm Analysis.
What Is Algorithm Analysis?
Examples of Algorithm Running Times.
The Maximum Contiguous Subsequence Sum Problem.
The Obvious O (N) Algorithm.
An Improved O(N 2) Algorithm.
A Linear Algorithm.
General Big-Oh Rules.
The Logarithm.
Static Searching Problem.
Sequential Search.
Binary Search.
Interpolation Search.
Checking an Algorithm Analysis.
Limitations of Big-Oh Analysis.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

6. Data Structures.
Why Do We Need Data Structures?
Stacks.
Stacks and Computer Languages.
Queues.
Linked Lists.
General Trees.
Binary Search Trees.
Hash Tables.
Priority Queues.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

7. Recursion.
What Is Recursion?
Background: Proofs by Mathematical Induction.
Basic Recursion.
Printing Numbers in Any Base.
Why It Works.
How It Works.
Too Much Recursion Can Be Dangerous.
Additional Examples.
Numerical Applications.
Modular Arithmetic.
Modular Exponentiation.
Greatest Common Divisor and Multiplicative Inverses.
The RSA Cryptosystem.
Divide-and-Conquer Algorithms.
The Maximum Contiguous Subsequence Sum Problem.
Analysis of a Basic Divide-and-Conquer Recurrence.
A General Upper Bound for Divide-and-Conquer Running Times.
Dynamic Programming.
Backtracking Algorithms.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

8. Sorting Algorithms.
Why Is Sorting Important?
Preliminaries.
Analysis of the Insertion Sort and Other Simple Sorts.
Shellsort.
Performance of Shellsort.
Mergesort.
Linear-time Merging of Sorted Arrays.
The Mergesort Algorithm.
Quicksort.
The Quicksort Algorithm.
Analysis of Quicksort.
Picking the Pivot.
A Partitioning Strategy.
Keys Equal to the Pivot.
Median-of-three Partitioning.
Small Arrays.
Java Quicksort Routine.
Quickselect.
A Lower Bound for Sorting.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

9. Randomization.
Why Do We Need Random Numbers?
Random-number Generators.
Nonuniform Random Numbers.
Generating a Random Permutation.
Randomized Algorithms.
Randomized Primality Testing.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

III. APPLICATIONS.

10. Fun and Games.
10.1Word Search Puzzles.
Theory.
Java Implementation.
10.2The Game of Tic-Tac-Toe.
Alpha-beta Pruning.
Transposition Tables.
Computer Chess.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

11. Stacks and Compilers.
Balanced-symbol Checker.
Basic Algorithm.
Implementation.
A Simple Calculator.
Postfix Machines.
Infix to Postfix Conversion.
Implementation.
Expression Trees.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

12. Utilities.
File Compression.
Prefix Codes.
Huffman's Algorithm.
The Encoding Phase.
Decoding Phase.
Practical Considerations.
A Cross-Reference Generator.
Basic Ideas.
Java Implementation.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

13. Simulation.
The Josephus Problem.
The Simple Solution.
A More Efficient Algorithm.
Event-driven Simulation.
Basic Ideas.
Example: A Modem Bank Simulation.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.

14. Graphs and Paths.
Definitions.
Representation.
Unweighted Shortest-path Problem.
Theory.
Java Implementation.
Positive-weighted, Shortest-path Problem.
Theory: Dijkstra's Algorithm.
Java Implementation.
Negative-weighted, Shortest-path Problem.
Theory.
Java Implementation.
Path Problems in Acyclic Graphs.
Topological Sorting.
Theory of the Acyclic Shortest-path Algorithm.
Java Implementation.
An Application: Critical-path Analysis.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

IV. IMPLEMENTATIONS.

15. Stacks and Queues.
Dynamic Array Implementations.
Stacks.
Queues.
Linked-list Implementations.
Stacks.
Queues.
Comparison of the Two Methods.
Double-ended Queues.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.

16. Linked Lists.
Basic Ideas.
Header Nodes.
Iterator Classes.
Java Implementation.
Doubly Linked Lists and Circular Linked Lists.
Sorted Linked Lists.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.

17. Trees.
General Trees.
Definitions.
Implementation.
An Application: File Systems.
Binary Trees.
Recursion and Trees.
Tree Traversal: Iterator Classes.
Postorder Traversal.
Inorder Traversal.
Preorder Traversal.
Level-order Traversals.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.

18. Binary Search Trees.
Basic Ideas.
The Operations.
Java Implementation.
Order Statistics.
Java Implementation.
Analysis of Binary Search Tree Operations.
AVL Trees.
Properties.
Single Rotation.
Double Rotation.
Summary of AVL Insertion.
Red-Black Trees.
Bottom-up Insertion.
Top-down Red-Black Trees.
Java Implementation.
Top-down Deletion.
AA-Trees.
Insertion.
Deletion.
Java Implementation.
B-Trees.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

19. Hash Tables.
Basic Ideas.
Hash Function.
Linear Probing.
Naive Analysis of Linear Probing.
What Really Happens: Primary Clustering.
Analysis of the find Operation.
Quadratic Probing.
Java Implementation.
Analysis of Quadratic Probing.
Separate Chaining Hashing.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

20. A Priority Queue: The Binary Heap.
Basic Ideas.
Structure Property.
Heap-order Property.
Allowed Operations.
Implementation of the Basic Operations.
insert.
deleteMin.
fixHeap: Linear Time Heap Construction.
Advanced Operations: decreaseKey and merge.
Internal Sorting: Heapsort.
External Sorting.
Why We Need New Algorithms.
Model for External Sorting.
The Simple Algorithm.
Multiway Merge.
Polyphase Merge.
Replacement Selection.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

V. ADVANCED DATA STRUCTURES.

21. Splay Trees.
Self-adjustment and Amortized Analysis.
Amortized Time Bounds.
A Simple Self-adjusting Strategy (That Does Not Work).
The Basic Bottom-up Splay Tree.
Basic Splay Tree Operations.
Analysis of Bottom-up Splaying.
Proof of the Splaying Bound.
Top-down Splay Trees.
Implementation of Top-down Splay Trees.
Comparison of the Splay Tree with Other Search Trees.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

22. Merging Priority Queues.
The Skew Heap.
Merging Is Fundamental.
Simplistic Merging of Heap-Ordered Trees.
The Skew Heap: A Simple Modification.
Analysis of the Skew Heap.
The Pairing Heap.
Pairing Heap Operations and Theory.
Implementation of the Pairing Heap.
Application: Dijkstra's Shortest Weighted Path Algorithm.
Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
References.

23. The Disjoint Set Class.
Equivalence Relations.
Dynamic Equivalence and Two Applications.
Application #1: Minimum Spanning Trees.
Application #2: The Nearest Common Ancestor Problem.
The Quick-find Algorithm.
The Quick-union Algorithm.
Smart Union Algorithms.
Path Compression.
Java Implementation.
Worst Case for Union-by-rank and Path Compression.
Analysis of the Union/Find Algorithm.
Summary.
Objects of the Game.
Common Error.
On the Internet.
Exercises.
References.

APPENDICES.

Appendix A: Java Platforms.
Setting the Environment.
Unix Instructions.
Windows 95/NT Instructions.
Sun's JDK.
Visual Development Environments.
Symantec Cafe.
Microsoft Visual J++.

Appendix B: Operators.
Appendix C: Some Library Routines .
Classes in Package java.lang.
Character.
Integer.
Object.
String.
StringBuffer.
System.
Thread.
Throwable.

Classes in Package java.io.
BufferedReader.
File.
FileReader.
InputStreamReader.
PushbackReader.

Classes in Package java.util.
Random.
StringTokenizer.
Vector.
On the Internet.


Appendix D: Graphical User Interfaces.
The Abstract Window Toolkit.
Basic Objects in the AWT.
Component.
Container.
Top-level Windows.
Panel.
Important I/O Components.

Basic AWT Principles.
Layout Managers.
Graphics.
Events.
Summary: Putting the Pieces Together.

Animations and Threads.
Applets.
Hypertext Markup Language.
Parameters.
Applet Limitations.
Making an Application an Applet.
Applets with Animation.


Summary.
Objects of the Game.
Common Errors.
On the Internet.
Exercises.
Reference.
Index. 0201549913T04062001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020