Data Structure and Algorithm Analysis Study Notes (4) -- stack ADT, data structure and Algorithm
I. what is stack ADT?
1. Definition
Stack is a table that can only be inserted or deleted at one position.
2. Illustration
3. Basic stack Functions
(1) Whether it is null
(2) Stack
(3) outbound Stack
(4) Clear
(5) top stack
Ii. Stack Linked List Implementation
What is the basis for junior high school students' self-learning data structure?
I. Different definitions of data structures
Data structures are used by computers to store and organize data. A Data Structure refers to a set of data elements with one or more specific relationships between each other. Generally, a well-selected data structure can improve the running or storage efficiency. Data structures are often related to efficient search algorithms and indexing technologies.
Data structures have no standard definitions in the computer scientific community. Individuals have different expressions based on their understanding:
In his book "data structures, algorithms, and applications", Sartaj Sahni said: "data structures are data objects, and various connections between the instances of the object and the data elements that constitute the instance. These links can be provided by defining related functions ." It defines a data object as a collection of instances or values ".
The definition of Clifford A. Shaffer in "Data structure and algorithm analysis" is: "Data structure is the physical implementation of ADT (Abstract Data Type ."
Lobert L. Kruse divides the design process of a data structure into the abstraction layer, data structure layer, and Implementation Layer in data structure and program design. The abstraction layer refers to the abstraction data type layer, which discusses the logical structure of data and its operations, the data structure layer and Implementation Layer discuss the representation of a data structure, the storage details of a computer, and the implementation of operations.
Ii. Significance of Data Structure
Generally, a data structure is organized by data elements based on certain logical connections. The description of the logical relationship between data elements is called the logical structure of data. Data must be stored in a computer, and the data storage structure is the implementation form of the data structure, which is expressed in a computer; in addition, to discuss a data structure, we must also discuss the operations performed on this type of data to make sense.
In the design of many types of programs, data structure selection is a basic design consideration. The construction experience of many large systems shows that the difficulty of system implementation and the quality of system construction depend heavily on whether the optimal data structure is selected. Many times, after the data structure is determined, the algorithm is easy to get. Sometimes things will turn around. We choose the data structure and adapt to the specific algorithm. In either case, it is very important to select an appropriate data structure.
The data structure is selected, and the algorithm is determined accordingly. data rather than algorithms are the key factors in system construction. This insight leads to the emergence of many software design methods and programming languages. object-oriented programming languages are one of them.
Iii. Data Structure
In computer science, data structure is a discipline that studies the operating objects (data elements) of computers and their relationships and operations in non-numerical computing programming, make sure that the new structure obtained after these operations is still the original structure type.
"Data Structure", as an independent course, was established in foreign countries since 1968. In 1968, Professor Tang ou knot created the initial system of data structure, his first volume of computer programming skills, basic algorithms, is the first book that systematically describes the logical structure, storage structure, and operations of data. "Data Structure" is a comprehensive basic professional course in computer science. Data structure is a core course between mathematics, computer hardware, and computer software. Data structure is not only the basis of general programming (especially non-numerical programming, it is also an important foundation for designing and implementing compilation programs, operating systems, database systems, and other system programs.
Computer is a science that studies Information Representation and processing using computers. There are two problems involved: Information Representation and information processing.
The Information Representation and organization are directly related to the efficiency of the information processing procedure. With the popularization of computers, the increase of Information and the widening of information scope, many system programs and applications are large in size, and the structure is quite complex. Therefore, in order to compile a "good" program, we must analyze the features of the objects to be processed and the relationships between the objects. This is the problem to be studied in the course of data structure. As we all know, computer programs process information. In most cases, these are... the remaining full text>