当前位置:网站首页>集合--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 新增和删除速度很快。
边栏推荐
- LeetCode_22_Apr_2nd_Week
- 度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
- (TensorFlow) - detailed explanation of tf.variable_scope and tf.name_scope
- Attention Is All You Need(Transformer)
- MOOSE平台使用入门攻略——如何运行官方教程的例子
- No matching function for call to 'RCTBridgeModuleNameForClass'
- Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
- Comparison of oracle's number and postgresql's numeric
- Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
- How to get started with MOOSE platform - an example of how to run the official tutorial
猜你喜欢

YOLOV4流程图(方便理解)

【CV-Learning】Object Detection & Instance Segmentation

No matching function for call to ‘RCTBridgeModuleNameForClass‘

Use of double pointers

Halcon缺陷检测

MNIST手写数字识别 —— Lenet-5首个商用级别卷积神经网络

Golang environment variable settings (2)--GOMODULE & GOPROXY

Copy攻城狮信手”粘“来 AI 对对联

深度确定性策略梯度(DDPG)

深度学习理论 —— 初始化、参数调节
随机推荐
makefile基础学习
LeetCode_Nov_3rd_Week
LeetCode_22_Apr_2nd_Week
DeblurGAN-v2: Deblurring (Orders-of-Magnitude) Faster and Better 图像去模糊
LeetCode_Dec_3rd_Week
周志华机器学习
MNIST手写数字识别 —— 从感知机到卷积神经网络
度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
图像线性融合
LeetCode_Nov_4th_Week
图像合并水平拼接
MNIST手写数字识别 —— 基于Mindspore快速构建感知机实现十分类
DRA821 环境搭建
Amazon Cloud Technology Build On 2022 - AIot Season 2 IoT Special Experiment Experience
Attention Is All You Need(Transformer)
Golang环境变量设置(二)--GOMODULE&GOPROXY
LeetCode_Dec_2nd_Week
MNIST handwritten digit recognition, sorted by from two to ten
第三章 标准单元库(上)
Lee‘s way of Deep Learning 深度学习笔记
