当前位置:网站首页>What is a linear table?
What is a linear table?
2022-07-28 06:52:00 【Xiao Qiao】
Catalog
1. The order sheet (ArrayList)
The linear table (List)
Between elements is a “ linear ” The relationship between , Each element has at most one precursor and successor .
Linear table can be divided into sequence table and chain table .
1. The order sheet (ArrayList)
① Sequence table is a broader concept in data structure , An array is Java More specific concepts in , Arrays are a typical way to implement sequential tables ;
② Between elements , In contiguous memory space ( In order , But it doesn't mean order );
③capacity Containers 、size Element number , All subscripts in the linear table are only related to the number of elements , Container independent ;
④Java When implementing the sequence table , There is a special class ArrayList( Generic classes , Specify through generic parameters ArrayList What types of data can be stored in ), It encapsulates ordinary arrays ;
⑤ArrayList It's the realization of List The class of the interface , That is the List Abstract methods in ( Common methods of adding, deleting, modifying and checking ) Duyi Once realized .
2. Linked list (LinkedList)
The linked list contains many nodes ( Of course, it can also contain zero nodes ). Every node (Node) It contains the value of the element (value) And point to (next),next Used to point to the next node , The tail node points to null.
public class Node {
int value; // value
Node next; // Point to
}
① Between elements , Can be in discontinuous memory space ;
② Linked lists have nothing to do with arrays , Can't use index Direct subscript removal , But it can be done get/set Method to get the subscript , It's just more inefficient than sequential subscript removal ;
③ A linked list is different from a sequential list , Sequential tables are in contiguous memory space , As long as you continue down the memory, you can find the next node ( Subscript self increasing ); The linked list finds nodes through nodes ;
④ In a one-way list : Only through the current node , Find the next node , Cannot find the previous node , For a single chain watch , As long as you know the head node of the linked list , You can get all the elements of the linked list , You can use the head node to refer to the entire linked list , For example, parameters in methods ;
In a two-way list : Through the current node , You can find the next node , You can also find the previous node ;
⑤ Linked list with puppet nodes : Not actually storing data , Just for a place ;
Linked list without puppet nodes : Actual stored data ;
⑥ Linked list : The last element does not point to null, Instead, it points to a node on the linked list ;
Linked list without Links : The last element points to null;
④⑤⑥ These three sets of attributes are irrelevant , You can rehearse the combination at will , Derived from 8 Middle linked list !
( One way without puppets and rings and Two way puppet belt ring These two kinds are more common )
In essence, it is to solve the problem of “ Carry ” problem , For example, insert or delete in the middle , Can directly change next The direction of , Linked list is avoided “ Carry ”;
边栏推荐
- Explain in detail
- Water bottle effect production
- What kind of air conduction Bluetooth headset with good configuration is recommended
- Graphic pipeline foundation (II)
- MySQL常用命令
- Qgraphicsview promoted to qchartview
- Ten thousand words summarize and realize the commonly used sorting and performance comparison
- 测试面试题集锦(一)| 软件测试常见必考问题与流程篇(附答案)
- HDU-5805-NanoApe Loves Sequence(思维题)
- Hdu-5783 divide the sequence (greedy water question)
猜你喜欢
![[c language] - step by step to achieve minesweeping games](/img/ee/49ddfcd948ccd5c8c9dec3c48c6112.png)
[c language] - step by step to achieve minesweeping games
![[explain in detail how to realize Sanzi chess step by step]](/img/17/68ef51ec2be0c86019461116ecaa82.png)
[explain in detail how to realize Sanzi chess step by step]

技术分享 | 使用 cURL 发送请求

What's a good gift for Tanabata? Niche and advanced product gift recommendation

Mongo SSL configuration practice

NFS 共享存储服务

技术分享 | 服务端接口自动化测试, Requests 库的这些功能你了解吗?

MySQL master master

How to calculate the size of structure, segment and Consortium (common body)

Which brand of air conduction earphones is good and highly praised
随机推荐
Analysis of the semaphore source code of AQS
软件测试的生命周期(流程)
Ubuntu18.04搭建redis集群【学习笔记】
Which brand of air conduction earphones is better? These four should not be missed
[explain in detail how to realize Sanzi chess step by step]
PKU-2739-Sum of Consecutive Prime Numbers(筛素数法打表)
PKU-2524-Ubiquitous Religions(并查集模板)
QGraphicsView提升为QChartView
Optimization ideas from ordinary query commodities to highly concurrent query commodities
Brief analysis of order transaction
How about air conduction Bluetooth headset? It's the most worthwhile air conduction headset to start with
Redis implementation of distributed lock and analysis of the main process of redismission distributed lock
NIO示例
C language memcpy library functions and the role of memmove
RayMarching realizes volume light rendering
ISO 3.0-server three power separation configuration
Water rendering example
链表中结点的插入和删除
Mongodb replica set and partitioned cluster
如何描述一个BUG以及BUG级别的定义、生命周期