1. Concept
is the way computers store and organize data, which refers to a collection of one or more specific relationships between data elements.
2. Function
(1) Insert a new data item
(2) Find a specific data item
(3) Delete a specific data item
(3) Iteratively access each data item for display or other operations
3. Common data structures
(1) Linear table
The most commonly used and simplest data structure, it is a finite sequence of n data elements,
Implement linear table: Output and store linear table elements, that is, use a set of continuous storage units to store linear table data elements in sequence. The other is to use a linked list to store linear table elements, and use a set of arbitrary storage units to store linear table data. Elements (storage units can be continuous or discontinuous).
(2) Stack
First in, last out
(3) Queue
Add elements in a section . Remove the element from the other end. In and out of the queue. Usage scenarios: Because of the first-in-first-out nature of the queue, it is very suitable for multi-thread blocking queue management.
(4) Linked list
A non-continuous and non-sequential storage structure on the physical storage unit. The logical sequence of data elements is realized through the pointer address of the linked list. Each The element contains two nodes, one is the data field (storage space) that stores the element, and the other is the pointer field pointing to the next node.
(5) Tree
A data structure, a collection of hierarchical relationships composed of n (n>=1) limited nodes.
The basic data types of Java are divided into:
1. Integer type, used to represent the data type of integer.
2. Floating point type, a data type used to represent decimals.
3. Character type. The keyword of character type is "char".
4. Boolean type is the basic data type that represents logical values.
The above is the detailed content of What is the role of java data structure. For more information, please follow other related articles on the PHP Chinese website!