Focus:
1. An in-depth understanding of the backpacks, queues, and stacks that support generics and iterations is important for three reasons:
· We will construct the other more advanced data structures in this book with these data types as the cornerstone;
· They demonstrate the relationship between data structures and algorithms and the challenges of meeting multiple potentially conflicting performance goals;
· Some of the algorithms we are going to learn focus on the need for the abstract data types to support powerful operations on collections of objects, which are our starting points.
2. We now have two ways to represent collections of objects, that is, arrays and linked lists. Java has built-in arrays, and linked lists are easy to implement in Java's standard way. Both are very basic and are often referred to as sequential storage and chained storage.
Later in this book, we will extend these basic data structures in a variety of ways in the implementation of various abstract data types:
One of the most important extensions is a variety of data structures with multiple links, such as binary trees;
Another important extension is the composite data structure: We can use the Backpack storage stack, the queue to store arrays and so on, for example, we can use an array of backpacks to represent it.
It's easy to define arbitrarily complex data structures in this way, and one of the important reasons we focus on abstract data types is trying to control this complexity.
3. When researching a new application area, we will follow the steps below to identify the target and use the data abstraction to solve the problem:
· Define the API;
· Develop use case code based on specific application scenarios;
· Describes a data structure (a representation of a set of values) and defines an instance variable of the class according to the implementation of the abstract data type corresponding to the API;
· Describe the algorithm (the way to implement a set of actions) and implement the instance method in the class according to it;
· Analyze the performance characteristics of the algorithm.
Algorithm (4th edition) -1.3.4 overview