当前位置:网站首页>集合--LinkedList
集合--LinkedList
2022-08-04 05:30:00 【Tokey_W】
前言
LinkedList---底层是双向链表
是有序,地址可以不联系,并且存入的数据可以重复
链表的基本单位是节点,双向链表的节点有两个地址区,头地址和尾地址
LinkedList没有默认容量,在增删元素时,LinkedList效率要高,要随机访问的时候ArrayList效率会略高
一、LinkedList的重要属性
1.链表的长度
2.链表的头结点
初始化的时候头结点为空 尾节点为空 头结点的前驱节点为空 头结点的item值为空
3.链表的尾节点
初始化的时候头结点为空 尾节点为空 尾结点的后继节点为空 尾结点的item值为空
4. 节点的情况
item元素值 prev前驱节点的地址 next后继节点的地址
二、新增
1.从头部加入
2.从尾部加入
三、删除
1.从头部删除
2.从尾部删除
总结
链表结构的节点新增、删除,把前后节点的指向修改,所以 LinkedList 新增和删除速度很快。
边栏推荐
- Use of double pointers
- 第一章 绪论
- The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
- 度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
- MNIST手写数字识别 —— 从二分类到十分类
- Copy攻城狮5分钟在线体验 MindIR 格式模型生成
- 【深度学习日记】第一天:Hello world,Hello CNN MNIST
- 【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
- 如何用Pygame制作简单的贪吃蛇游戏
- 动手学深度学习__数据操作
猜你喜欢
【CV-Learning】Object Detection & Instance Segmentation
剪映专业版字幕导出随笔
Copy Siege Lions "sticky" to AI couplets
CSDN spree -- college round table spree
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
数据库的简述与常用操作指南
深度学习,“粮草”先行--浅谈数据集获取之道
MNIST Handwritten Digit Recognition - Image Analysis Method for Binary Classification
【论文阅读】TransReID: Transformer-based Object Re-Identification
【论文阅读】Anchor-Free Person Search
随机推荐
PyTorch
深度学习,“粮草”先行--浅谈数据集获取之道
动手学深度学习__张量
arm-2-基础阶段
LeetCode_22_Apr_4th_Week
软著撰写注意事项
MFC读取点云,只能正常显示第一个,显示后面时报错
makefile基础学习
(TensorFlow) - detailed explanation of tf.variable_scope and tf.name_scope
度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
yoloV5 使用——训练速度慢,加速训练
Lee‘s way of Deep Learning 深度学习笔记
ValueError: Expected 96 from C header, got 88 from PyObject
MNIST手写数字识别 —— 图像分析法实现二分类
lstm pipeline 过程理解(输入输出)
sbl_init.asm-适合在编辑模式下看
第三章 标准单元库(上)
Unity ML-agents 参数设置解明
target has libraries with conflicting names: libcrypto.a and libssl.a.
第二章 STA相关概念