文档介绍:5
Algorithms and Data Structures
© N. Wirth 1985 (Oberon version: August 2004)
Contents
Preface
1 Fundamental Data Structures
Introduction
The Concept of Data Type
Primitive Data Types
Standard Primitive Types
Integer types
The type REAL
The type BOOLEAN
The type CHAR
The type SET
The Array Structure
The Record Structure
Representation of Arrays, Records, and Sets
Representation of Arrays
Representation of Recors
Representation of Sets
The File (Sequence)
Elementary File Operators
Buffering Sequences
Buffering between Concurrent Processes
Textual Input and Output
Searching
Linear Search
Binary Search
Table Search
Straight String Search
The Knuth-Morris-Pratt String Search
The Boyer-Moore String Search
Exercises
2 Sorting
Introduction
Sorting Arrays
Sorting by Straight Insertion
Sorting by Straight Selection
Sorting by Straight Exchange
Advanced Sorting Methods
Insertion Sort by Diminishing Increment
Tree Sort
Partition Sort
Finding the Median
parison of Array Sorting Methods
Sorting Sequences
Straight Merging
Natural Merging
Balanced Multiway Merging
Polyphase Sort
Distribution of Initial Runs
Exercises
6
3 Recursive Algorithms
Introduction
When Not to Use Recursion
Two Examples of Recursive Programs
Backtracking Algorithms
The Eight Queens Problem
The Stable Marriage Problem
The Optimal Selection Problem
Exercises
4 Dynamic Information Structures
Recursive Data Types
Pointers
Linear Lists
Basic Operations
Ordered Lists and anizing Lists
An Application: Topological Sorting
Tree Structures
Ba