Abstract data types and subprograms
We do not know how to conform to the structure, this abstract container is known as abstract data types.
Abstract data type
Abstract data types abstract design goal is to reduce the complexity.
Abstract data types: clear separation properties of a particular container.
We can at the application layer, the logic layer, three layers to achieve the observed data.
The application layer is a particular view of the data in question. Logical layer is the data value and an abstract view of their processing operations. Layer structure of the process to achieve clear that want to store data, and operational data encoded program design language. This layer design data structure.
Data structures: implement an abstract data type in the data fields of the composite.
Containers: storing objects and other objects of the operation.
Stack
Stack is in line with an abstract structure, accessible only from some elements of the stack. Elements can be inserted in the first place, or you can delete the first element.
Another way of describing the behavior of the stack to access the deleted items argument is always the shortest stack of the project.
queue
Queue structure is abstract. In the tail of the queue insertion operation is performed, the operation proceeds to delete the head of the queue.
List
Wherein the list has three attributes: homogenous project, the project is linear, a variable-length list.
// array structure is built, the list is an abstract structure //
List can also be visualized as a chain structure.
If unordered list, items will be printed in the order in which they insert. If is an ordered list of items will be ordered printed.
tree
Binary Tree
Binary Tree is an abstract structure, the successor node: children. The original node: root. No child nodes: leaf node
Binary search tree
The value of all the nodes must be greater than the value of any node in his left subtree and smaller than his right subtree of all nodes in the value of hair.
Map
FIG: a set of nodes and a set of data structures constitute the connecting node.
Vertices: nodes in the graph.
Edge: FIG links of vertices of the two nodes.
Undirected graph: where there is no direction in FIG.
Directed graph: wherein edge is directed from one vertex to another vertex
Pro vertices: two vertices linked together by side
Construction diagram:
Create a table
Adding a vertex in the table
Add a side of the table
Add a weight in the table
Graph algorithms
Depth-first search
BFS
Subroutine
Parameter passing
Communication mechanism between the two parts of the program parameter list
Parameter listed in parentheses after the identifier of the subprogram name
Subroutine call argument identifier listed in parentheses
Participation reference parameter value
Reference values: argument passed by the calling unit copies parameter
Reference parameter: the incoming calling unit formed by the address parameter argument
Object-oriented design and high-level programming language
Object-oriented approach
Object-Oriented
Object: things or entities related issues in the background.
Class: A set of objects with similar properties and description of the behavior.
Domain: specific item class, it may be data or subroutines.
Methods: The definition of a specific algorithm behavior class.
Design Method
Brainstorm (first stage), filtered, scene (to determine the behavior of each class), responsibility algorithm (written algorithm is the responsibility of the listed class)
Examples of a computer
Translation process
Assembly language input assembler
translater
Compiler: translates programs written in high-level language into machine code.
Interpreter
Interpreter: Enter the language written in high-level program guide program a computer to perform the actions specified in each statement.
Compiled / interpreted
byte code: a standard machine to compile the Java source code language used.
Portable Java program with the Java compiler output will be explained, rather than always being executed Java program is translated into machine code instead of bytecode.