Classic Data Structures in Java
暫譯: Java 中的經典資料結構

Timothy Budd

買這商品的人也買了...

相關主題

商品描述


Description

With this book, Tim Budd looks at data structures by providing a solid foundation on the ADT, and uses the graphical elements found in Java when possible.

The beginning chapters provide the foundation on which everything else will be built. These chapters define the essential concept of the abstract data type (ADT), and describe the tools used in the evaluation and analysis of data structures. The book moves on to provide a detailed description of the two most important fundamental data abstractions, the vector and the linked list, providing an explanation of some of the more common variations on these fundamental ideas.

Next, the material considers data structures applicable to problems in which the order that values are added to a collection is important, followed by a consideration of the various different ways in which binary trees are used in the creation of data structures. The last few chapters consider a sequence of more advanced data structures. Most are constructed as adaptors built on top of earlier abstractions. Hash tables are introduced first as a technique for implementing simple collections, and later as a tool for developing efficient maps. Lastly, the graph data type is considered. Here there are several alternative data structures presentations in common use, and the emphasis in this chapter is more on the development and analysis of useful algorithms than on any particular data structure.

Back to Top


Appropriate Courses

Java Data Structures/CS2.

Back to Top


Features

  • An object-oriented mindset is applied throughout.
  • The clear separation between ADT (interface) and implementation is emphasized throughout.
  • A rigorous approach to development in encouraged, with techniques for developing formal proofs of programs being presented, and proofs of programs appearing throughout the text.
  • An explorational and visual approach is encouraged by providing tools that make it easy to create a visual record of execution time, and Experiments that will help see aspects of execution that may not be obvious from the code.
  • Important software patterns are highlighted, and the use of patterns is emphasized from the beginning.
  • Graphical elements, chosen to minimize the unnecessary detail and emphasize the important lessons of Java, are used to motivate the student's interest in the material.
  • Sidebars are included throughout so that readers can then peruse additional information as they choose.
  • End of Chapter material is designed to aid students comprehension of the material just presented, including: a chapter summary, glossary of key terms, numerous basic study questions, a collection of thought-provoking exercises, and a series of programming projects.
  • An appendix with an overview of Java syntax makes this book appropriate for readers without a Java background.
  • Written by Tim Budd, author of numerous other successful texts, including Classic Data Structures in C++, Data Structures in C++ with the STL, Introduction to Object Oriented Programming, and C++ for Java Programmers.
Back to Top


Table Of Contents

(All chapters conclude with "Chapter Summary", "Further Information", "Study Questions", "Exercises", and "Programming Projects".)
1. The Management of Complexity.

The Control of Complexity.
Abstraction, Information Hiding, and Layering.
Division into Parts.
Encapsulation and Interchangeability.
Interface and Implementation.
The Service View.
Repetition and Recursion.

Composition.
Layers of Specialization.
Multiple Views.
Patterns.

2. Abstract Data Types.
What is a Type?
Classes.
Interfaces and Polymorphism.

Abstract Data Types.
The Fundamental ADTs.
Collection.
Bag.
Set.
Sorted, Comparator and Comparable.
Stack, Queue and Deque.
FindMin and FindNth.
Indexed Collections and Sorting Algorithms.
Map.
Matrix.


3. Algorithms.
Characteristics of Algorithms.
Recipes as Algorithms.
Analyzing Computer Algorithms.
Specification of the Input.
Description of the Result.
Instruction Precision.
Time to Execute.
Space Utilization.

Recursive Algorithms.

4. Execution-Time Measurement.
Algorithmic Analysis and Big-Oh Notation.
Execution Time of Programming Constructs.
Constant Time.
Simple Loops.
Nested Loops.
While Loops.
Function Calls.

Summing Algorithmic Execution Times.
The Importance of Fast Algorithms.
Benchmarking and Actual Execution Times.

5. Increasing Confidence in Correctness.
Program Proofs.
Invariants.
Analyzing Loops.
Asserting That the Outcome is Correct.
Progress Toward an Objective.
Manipulating Unnamed Quantities.
Function Calls.
Recursive Algorithms.

Program Testing.

6. Vectors.
The Vector Data Structure.
Enumeration.
Application—Silly Sentences.
Application—Memory Game.
Application—Shell Sort.

A Visual Vector.

7. Sorting Vectors.
Divide and Conquer.
Binary Search.

Sorted Vectors.
Merge Sort.
Partitioning.
The Pivot Algorithm.
Finding the nth Element.
Quick Sort.


8. Linked Lists.
Varieties of Linked Lists.
LISP-Style Lists.
The LinkedList Abstraction.
Application—Asteroids Game.
Application—Infinite-Precision Integers.

9. List Variations.
Sorted Lists.
Fast Merge.
Execution Timings for Merge Operations.

Self-Organizing Lists.
Skip Lists.

10. Stacks.
The Stack ADT.
Checking for Balanced Parentheses.
Towers of Hanoi, Revisited.
A Four-Function Calculator.
A Solitaire Program.
Implementation of the Stack Abstraction.

11. Deques.
A Fractal Snowflake.
Depth- and Breadth-First Search.
An Implementation: The IndexedDeque.

12. Queues.
The Queue ADT.
The Caterpillar Game.
A Pastry Factory Simulation.
Implementation of the Queue Abstraction.
A Vector-Based Queue.
The Ring Buffer Queue.
Piped Input/Output Streams.


13. Trees.
Binary Trees.
Vector Implementation.
Dynamic Memory Implementation.
Application—Guess the Animal Game.

Tree Traversals.
Postorder Tree Traversal.
Preorder Tree Traversal.
In-Order Tree Traversal.
Level-Order Tree Traversal.

Euler Tours.
Binary Tree Representation of General Trees.

14. Binary Search Trees.
The Importance of Balance.
AVL Trees.
Application—Tree Sort.

15. Priority Queues.
The Priority Queue ADT.
Heaps.
Skew Heaps.
Application—Discrete Event-Driven Simulation.
A Framework for Simulations.
Ice Cream Store Simulation.


16. Hash Tables.
Hash Functions.
Hash Functions.
Hash Functions in the Java Standard Library.

Collision Resolution.
Hash Table Sorting Algorithms.
Counting Sort.
Radix Sorting.

Open-Address Hashing.
The Hashtable Data Type.
Application—Ranking Poker Hands.

17. Maps.
Example Programs.
Silly Sentence Generation, Revisited.
An Address Database.
A Concordance.

An Implementation.
Searching Problems and Maps.

18. Sets.
Changing a Bag into a Set.
Set Union, Intersection, and Differences.
Sorted List Sets.
Application—A Spelling Checker.
The Union-Find Problem.
The BitSet Abstraction.
Application—Prime Number Sieve.


19. Matrices.
Java Matrices.
Application—Rain Game.
Binary Matrices.
Application—The Game of Life.

Sparse Vectors.
An Application—(Almost) Infinitely Large Hash Tables.

Sparse Matrices.
Noninteger Keys.

20. Graphs.
Adjacency-Matrix Representation.
Edge-List Representation.
Weighted-Graph Representation.
Weighted-Adjacency Matrix.
Floyd's Algorithm.
Weighted-Edge List Representation.
Dijkstra's Algorithm.

Other Graph Problems.
Topological Sorting.
Depth-First Search Spanning Tree.
Problem-The Traveling Salesman.


Appendix A. Java Syntax.
Program Structure.
Packages.
Import Declarations.
Class Declaration.
Interface Declaration.
Method Declaration.
Constructors.
Data Field Declaration.

Statements.
Declaration Statement.
Assignment Statement.
Procedure Calls.
If Statement.
Switch Statement.
While Statement.
For Statement.
Return Statement.
Throw Statement.
Try Statement.

Expressions.
Literal.
Variable.
Data Field and Method Access.
Operators.
Object Creation.
Arrays.

Files.

Appendix B. Import Libraries.
Appendix C. Data Structures in the Java Standard Library.
Collection.
Enumerators and Iterators.
Vectors.
Lists.
Stack, Queue, and Deque.
Priority Queue.
Binary Search Tree.
Hash Tables.
Set.
Map.

Bibliography.
Index.


Back to Top

商品描述(中文翻譯)

描述
本書由 Tim Budd 撰寫,探討資料結構,提供關於抽象資料型別 (ADT) 的堅實基礎,並在可能的情況下使用 Java 中的圖形元素。
前幾章提供了所有其他內容的基礎。這些章節定義了抽象資料型別 (ADT) 的基本概念,並描述了用於評估和分析資料結構的工具。本書接著詳細描述了兩個最重要的基本資料抽象:向量和鏈結串列,並解釋了一些這些基本概念的常見變體。
接下來的內容考慮了適用於值的添加順序對集合重要的問題的資料結構,然後考慮了二元樹在資料結構創建中的各種不同用法。最後幾章考慮了一系列更高級的資料結構。大多數是建立在早期抽象之上的適配器。哈希表首先作為實現簡單集合的技術引入,然後作為開發高效映射的工具。最後,考慮圖形資料型別。在這裡,有幾種常用的替代資料結構表示,這一章的重點更多在於有用演算法的開發和分析,而不是任何特定的資料結構。

適合的課程
Java 資料結構 / CS2。

特點
- 整體應用物件導向思維。
- 強調 ADT (介面) 與實作之間的明確區分。
- 鼓勵嚴謹的開發方法,提供開發程式正式證明的技術,並在文本中出現程式的證明。
- 提供工具以便輕鬆創建執行時間的視覺記錄,鼓勵探索和視覺化的方法,幫助觀察從程式碼中可能不明顯的執行方面。
- 突出重要的軟體模式,並從一開始就強調模式的使用。
- 使用圖形元素,選擇最小化不必要的細節並強調 Java 的重要教訓,以激發學生對材料的興趣。
- 在整本書中包含 側邊欄,讓讀者可以根據自己的選擇瀏覽額外資訊。
- 章節結尾 的材料旨在幫助學生理解剛剛呈現的內容,包括:章節摘要、關鍵術語詞彙表、眾多基本學習問題、一系列引人深思的練習和一系列程式設計專案。
- 附錄中提供 Java 語法概述,使本書適合沒有 Java 背景的讀者。
- 由 Tim Budd 撰寫,他是多本成功著作的作者,包括 C++ 中的經典資料結構、使用 STL 的 C++ 資料結構、物件導向程式設計導論為 Java 程式設計師準備的 C++。

目錄
所有章節結尾均包含「章節摘要」、「進一步資訊」、「學習問題」、「練習」和「程式設計專案」。
1. 複雜性的管理。
複雜性的控制。
抽象、資訊隱藏和分層。
分割成部分。
封裝和可互換性。
介面和實作。
服務視圖。
重複和遞迴。
組合。
專業化層次。
多重視圖。
模式。
2. 抽象資料型別。
什麼是型別?
類別。
介面和多型性。
抽象資料型別。
基本 ADT。
集合。
背包。
集合。
排序、比較器和可比較。
堆疊、佇列和雙端佇列。
FindMin 和 FindNth。
索引集合和排序演算法。
映射。
矩陣。
3. 演算法。
演算法的特徵。
食譜作為演算法。
分析計算機演算法。
輸入的規範。
結果的描述。
指令精確度。
執行時間。
空間利用。
遞迴演算法。
4. 執行時間測量。
演算法分析和大 O 符號。
程式構造的執行時間。
常數時間。
簡單迴圈。
嵌套迴圈。
While 迴圈。
函數呼叫。
總結演算法執行時間。
快速演算法的重要性。
基準測試和實際執行時間。
5. 增加正確性的信心。
程式證明。
不變式。
分析迴圈。
斷言結果正確。
朝向目標的進展。
操作未命名的數量。
函數呼叫。
遞迴演算法。
程式測試。
6. 向量。
向量資料結構。
列舉。
應用—愚蠢的句子。
應用—記憶遊戲。
應用—外殼排序。
視覺向量。
7. 排序向量。
分而治之。
二元搜尋。
排序向量。
合併排序。
分割。
樞紐演算法。
尋找 第 n 個元素。
快速排序。
8. 鏈結串列。
鏈結串列的變體。
LISP 風格的串列。
LinkedList 抽象。
應用—小行星遊戲。
應用—無限精度整數。
9. 串列變體。
排序串列。
快速合併。
合併操作的執行時間。
自我組織串列。
跳躍串列。
10. 堆疊。
堆疊 ADT。
檢查平衡括號。
河內塔,重訪。
四功能計算器。
一個接龍程式。
堆疊抽象的實作。
11. 雙端佇列。
一個分形雪花。
深度優先和廣度優先搜尋。
一個實作:IndexedDeque。
12. 佇列。
佇列 ADT。
毛毛蟲遊戲。
一個糕點工廠模擬。
佇列抽象的實作。
基於向量的佇列。
環形緩衝佇列。
管道輸入/輸出流。
13. 樹。
二元樹。
向量實作。
動態記憶體實作。
應用—猜動物遊戲。
樹的遍歷。
後序樹遍歷。
前序樹遍歷。
中序樹遍歷。
層序樹遍歷。
歐拉巡迴。
一般樹的二元樹表示。
14. 二元搜尋樹。
平衡的重要性。
AVL 樹。
應用—樹排序。
15. 優先佇列。
優先佇列 ADT。
堆。
偏斜堆。
應用—離散事件驅動模擬。
模擬框架。
冰淇淋店模擬。
16. 哈希表。
哈希函數。
Java 標準庫中的哈希函數。
碰撞解決。
哈希表排序演算法。
計數排序。
基數排序。
開放地址哈希。
哈希表資料型別。
應用—撲克牌手牌排名。
17. 映射。
範例程式。
愚蠢句子生成,重訪。
地址資料庫。
一個索引。
一個實作。
搜尋問題和映射。
18. 集合。
將背包轉換為集合。
集合的聯集、交集和差集。
排序串列集合。
應用—拼字檢查器。
聯集-查找問題。
BitSet 抽象。
應用—質數篩。
19. 矩陣。
Java 矩陣。
應用—雨水遊戲。
二元矩陣。
應用—生命遊戲。
稀疏向量。
應用—(幾乎) 無限大的哈希表。
稀疏矩陣。
非整數鍵。
20. 圖形。
鄰接矩陣表示。
邊列表表示。
加權圖表示。
加權鄰接矩陣。
Floyd 演算法。
加權邊列表表示。
Dijkstra 演算法。
其他圖形問題。
拓撲排序。
深度優先搜尋生成樹。
問題—旅行推銷員。
附錄 A. Java 語法。
程式結構。
套件。
匯入聲明。
類別聲明。
介面聲明。
方法聲明。
建構子。
資料欄位聲明。
陳述句。
聲明陳述句。
指派陳述句。
程序呼叫。
If 陳述句。
Switch 陳述句。
While 陳述句。
For 陳述句。
Return 陳述句。
Throw 陳述句。
Try 陳述句。
表達式。
字面量。
變數。
資料欄位和方法存取。
運算子。
物件創建。
陣列。
檔案。
附錄 B. 匯入函式庫。