CONTENTS

Preface

CHAPTER 0: Introduction to Java

Chapter Objectives

0.1 Java Fundamentals

0.1.1 Primitive Types

0.1.2 The char Type

0.2 Classes

0.2.1 The String Class

0.2.2 Using javadoc Notation for Method Specifications

0.2.3 Equality of References and Equality of Objects

0.2.4 Local Variables

0.2.5 The Scanner Class

0.3 Arrays

0.4 Arguments and Parameters

0.5 Output Formatting

Crossword Puzzle

Programming Exercises

CHAPTER 1: Object-Oriented Concepts

Chapter Objectives

1.1 Data Abstraction

1.2 Abstract Methods and Interfaces

1.2.1 Abstract Data Types and Data Structures

1.2.2 An Interface and a Class that Implements the Interface

1.2.3 Using the FullTimeEmployee Class

1.3 Inheritance

1.3.1 The protected Visibility Modifier

1.3.2 Inheritance and Constructors

1.3.3 The Subclass Substitution Rule

1.3.4 Is-a versus Has-a

1.4 Information Hiding

1.5 Polymorphism

1.6 The Unified Modeling Language

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 1.1: A CalendarDate Class

CHAPTER 2: Additional Features of Programming and Java

Chapter Objectives

2.1 Static Variables, Constants and Methods

2.2 Method Testing

2.2.1 More Details on Unit Testing

2.3 Exception Handling

2.3.1 Propagating Exceptions

2.3.2 Unit Testing and Propagated Exceptions

2.3.3 Checked Exceptions

2.3.4 The finally Block

2.4 File Output

2.5 System Testing

2.6 The Java Virtual Machine

2.6.1 Pre-Initialization of Fields

2.6.2 Garbage Collection

2.7 Packages

2.8 Overriding the Object Class's equals Method

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 2.1: An Integrated Web Browser and Search Engine, Part 1

CHAPTER 3: Analysis of Algorithms

Chapter Objectives

3.1 Estimating the Efficiency of Methods

3.1.1 Big-O Notation

3.1.2 Getting Big-O Estimates Quickly

3.1.3 Big-Omega, Big-Theta and Plain English

3.1.4 Growth Rates

3.1.5 Trade-Offs

3.2 Run-Time Analysis

3.2.1 Timing

3.2.2 Overview of the Random Class

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 3.1: Let's Make a Deal!

CHAPTER 4: The Java Collections Framework

Chapter Objectives

4.1 Collections

4.1.1 Collection Classes

4.1.2 Storage Structures for Collection Classes

4.2 Some Details of the Java Collections Framework

4.2.1 Abstract Classes

4.2.2 Parameterized Types

4.2.3 The Collection Interface

4.2.4 The List Interface

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 4.1: Wear a Developer's Hat and a User's Hat

CHAPTER 5: Recursion

Chapter Objectives

5.1 Introduction

5.2 Factorials

5.2.1 Execution Frames

5.3 Decimal to Binary

5.4 Towers of Hanoi

5.4.1 Analysis of the move Method

5.5 Searching an Array

5.6 Backtracking

5.6.1 An A-maze-ing Application

5.7 Indirect Recursion

5.8 The Cost of Recursion

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 5.1: Iterative Version of the Towers of Hanoi

Programming Project 5.2: Eight Queens

Programming Project 5.3: A Knight's Tour

Programming Project 5.4: Sudoku

Programming Project 5.5: Numbrix

CHAPTER 6: Array-Based Lists

Chapter Objectives

6.1 The List Interface

6.2 The ArrayList Class

6.2.1 Method Specifications for the ArrayList Class

6.2.2 A Simple Program with an ArrayList Object

6.2.3 The ArrayList Class's Heading and Fields

6.2.4 Definition of the One-Parameter add Method

6.3 Application: High-Precision Arithmetic

6.3.1 Method Specifications and Testing of the VeryLongInt Class

6.3.2 Fields in the VeryLongInt Class

6.3.3 Method Definitions of the VeryLongInt Class

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 6.1: Expanding the VeryLongInt Class

Programming Project 6.2: An Integrated Web Browser and Search Engine, Part 2

CHAPTER 7: Linked Lists

Chapter Objectives

7.1 What is a Linked List?

7.2 The SinglyLinkedList Class'A Singly-Linked, Toy Class!

7.2.1 Fields and Method Definitions in the SinglyLinkedList Class

7.2.2 Iterating through a SinglyLinkedList Object

7.3 Doubly-Linked Lists

7.3.1 A User's View of the LinkedList Class

7.3.2 The LinkedList Class versus the ArrayList Class

7.3.3 LinkedList Iterators

7.3.4 A Simple Program that uses a LinkedList Object

7.3.5 Fields and Heading of the LinkedList Class

7.3.6 Creating and Maintaining a LinkedList Object

7.3.7 Definition of the Two-Parameter add Method

7.4 Application: A Line Editor

7.4.1 Design and Testing of the Editor Class

7.4.2 Method Definitions for the Editor Class

7.4.3 Analysis of the Editor Class Methods

7.4.4 Design of the EditorUser Class

7.4.5 Implementation of the EditorUser Class

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 7.1: Expanding the SinglyLinkedList Class

Programming Project 7.2: Implementing the remove() Method in SinglyLinkedListIterator

Programming Project 7.3: Making a Circular Singly Linked List Class

Programming Project 7.4: Alternative Implementation of the LinkedList Class

Programming Project 7.5: Expanding the Line Editor

Programming Project 7.6: An Integrated Web Browser and Search Engine, Part 3

CHAPTER 8: Stacks and Queues

Chapter Objectives

8.1 Stacks

8.1.1 The Stack Class

8.1.2 A Fatal Flaw?

8.1.3 Stack Application 1: How Compilers Implement Recursion

8.1.4 Stack Application 2: Converting from Infix to Postfix

8.1.5 Prefix Notation

8.2 Queues

8.2.1 The Queue Interface

8.2.2 Implementations of the Queue Interface

8.2.3 Computer Simulation

8.2.4 Queue Application: A Simulated Car Wash

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 8.1: Making the Speedo's Car Wash Simulation More Realistic

Programming Project 8.2: Design, Test, and Implement a Program to Evaluate a Condition

Programming Project 8.3: Maze-Searching, Revisited

Programming Project 8.4: Fixing the Stack Class

CHAPTER 9: Binary Trees

Chapter Objectives

9.1 Definition of Binary Tree

9.2 Properties of Binary Trees

9.3 The Binary Tree Theorem

9.4 External Path Length

9.5 Traversals of a Binary Tree

Summary

Crossword Puzzle

Concept Exercises

CHAPTER 10: Binary Search Trees

Chapter Objectives

10.1 Binary Search Trees

10.1.1 The BinarySearchTree Implementation of the Set Interface

10.1.2 Implementation of the BinarySearchTree Class

10.2 Balanced Binary Search Trees

10.2.1 AVL Trees

10.2.2 The Height of an AVL Tree

10.2.3 The AVLTree Class

10.2.4 Runtime Estimates

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 10.1: An Alternate Implementation of the Binary-Search-Tree Data Type

Programming Project 10.2: Printing a BinarySearchTree Object

Programming Project 10.3: The fixAfterInsertion Method

Programming Project 10.4: ThefixAfterDeletion Method

CHAPTER 11: Sorting

Chapter Objectives

11.1 Introduction

11.2 Simple Sorts

11.2.1 Insertion Sort

11.2.2 Selection Sort

11.2.3 Bubble Sort

11.3 The Comparator Interface

11.4 How Fast Can we Sort?

11.4.1 Merge Sort

11.4.2 The Divide-and-Conquer Design Pattern

11.4.3 Quick Sort

11.5 Radix Sort

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 11.1: Sorting a File into Ascending Order

CHAPTER 12: Tree Maps and Tree Sets

Chapter Objectives

12.1 Red-Black Trees

12.1.1 The Height of a Red Black Tree

12.2 The Map Interface

12.3 The TreeMap Implementation of the SortedMap Interface

12.3.1 The TreeMap Class's Fields and Embedded Entry Class

12.3.2 Method Definitions in the TreeMap Class

12.4 Application of the TreeMap Class: a Simple Thesaurus

12.4.1 Design, Testing, and Implementation of the Thesaurus Class

12.4.2 Design and Testing of the ThesaurusUser Class

12.4.3 Implementation of the ThesaurusUser Class

12.5 The TreeSet Class

12.5.1 Implementation of the TreeSet Class

12.5.2 Application: A Simple Spell Checker

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 12.1: Spell Check, Revisited

Programming Project 12.2: Word Frequencies

Programming Project 12.3: Building a Concordance

Programming Project 12.4: Approval Voting

Programming Project 12.5: An Integrated Web Browser and Search Engine, Part 4

CHAPTER 13: Priority Queues

Chapter Objectives

13.1 Introduction

13.2 The PriorityQueue Class

13.3 Implementation Details of the PriorityQueue Class

13.3.1 Fields and Method Definitions in the PriorityQueue Class

13.4 The heapSort Method

13.4.1 Analysis of heapSort

13.5 Application: Huffman Codes

13.5.1 Huffman Trees

13.5.2 Greedy Algorithm Design Pattern

13.5.3 The Huffman Encoding Project

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 13.1: Decoding a Huffman-Encoded Message

Programming Project 13.2: An Integrated Web Browser and Search Engine, Part 5

CHAPTER 14: Hashing

Chapter Objectives

14.1 A Framework to Analyze Searching

14.2 Review of Searching

14.2.1 Sequential Search

14.2.2 Binary Search

14.2.3 Red-Black-Tree Search

14.3 The HashMap Implementation of the Map Interface

14.3.1 Hashing

14.3.2 The Uniform Hashing Assumption

14.3.3 Chaining

14.3.4 Implementation of the HashMap Class

14.3.5 Analysis of the containsKey Method

14.3.6 The HashIterator Class

14.3.7 Creating a Symbol Table by Hashing

14.4 The HashSet Class

14.5 Open-Address Hashing (optional)

14.5.1 The remove Method

14.5.2 Primary Clustering

14.5.3 Double Hashing

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 14.1: The Double Hashing Implementation of the HashMap Class

Programming Project 14.2: An Integrated Web Browser and Search Engine, Part 6

CHAPTER 15: Graphs, Trees, and Networks

Chapter Objectives

15.1 Undirected Graphs

15.2 Directed Graphs

15.3 Trees

15.4 Networks

15.5 Graph Algorithms

15.5.1 Iterators

15.5.2 Connectedness

15.5.3 Generating a Minimum Spanning Tree

15.5.4 Finding the Shortest Path through a Network

15.5.5 Finding the Longest Path through a Network?

15.6 A Network Class

15.6.1 Method Specifications and Testing of the Network Class

15.6.2 Fields in the Network Class

15.6.3 Method Definitions in the Network sClass

15.7 Backtracking Through A Network

Summary

Crossword Puzzle

Concept Exercises

Programming Exercises

Programming Project 15.1: The Traveling Salesperson Problem

Programming Project 15.2: Backtracking through a Network

Programming Project 15.3: Determining Critical Activities in a Project Network

Programming Project 15.4: An Integrated Web Browser and Search Engine, Part 7

APPENDIX 1: Additional Features of the JAVA Collections Framework

A1.1 Introduction

A1.2 Serialization

A1.3 Fail-Fast Iterators

APPENDIX 2: Mathematical Background

A2.1 Introduction

A2.2 Functions and Sequences

A2.3 Sums and Products

A2.4 Logarithms

A2.5 Mathematical Induction

A2.6 Induction and Recursion

Concept Exercises

APPENDIX 3: Choosing a Data Structure

A3.1 Introduction

A3.2 Time-Based Ordering

A3.3 Index-Based Ordering

A3.4 Comparison-Based Ordering

A3.5 Hash-Based Ordering

A3.6 Space Considerations

A3.7 The Best Data Structure?

References

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.159.82