当前位置:网站首页>Operations related to sequence table
Operations related to sequence table
2022-07-01 12:23:00 【Between the steps】
**
For the relevant operations of the sequence table
For the relevant operations of the sequence table
**
1、 The first is the initialization of the sequence table ( static state )
At initialization , Define the maximum length ( Like arrays , Can't expand ), And the actual length of the current stored data , Initialization defines the actual length as 0, The subsequent insertion value is incremented ,,

improvement ( Dynamic allocation )
If there's not enough memory , Will expand the space , Copy the original content
( The red line points to the first data element in the sequence table )
From the picture below ( How much space to expand ?)
Define pointer p Point to the first data location , And then use L.data Expand space , Copy the past , The maximum length of the sequence table is updated

Insert operation of sequence table ------------------
We are in the... Of the linear table i Location insert element e Return to update the linear table (&) , Thought is to move backward as a whole , take e Insert in ,

At the same time, we should also judge whether the space is full ,,, Or it is not allowed to insert more than the maximum length !!!!!!
The deletion of the sequence table -------------------
The deletion operation is to delete the i Deduct the value of , The elements behind move forward You can see the parameters (&)
Let's take out the deleted data and wait for it to return
Deletion is the opposite of insertion It's to remove it from the front and move it forward from the back

Search operation of sequence table ------------------
The search of static memory allocation only needs to return return L.data[i-1] that will do ( Pay attention to the i Bit order , An array is data[i-1])
( Search by bit )
Search by value By reference e Compare
By traversing L.data[i] and e Compare , Same return bit order
( According to the value lookup )
边栏推荐
- AI抠图工具
- Uniapp uses uni upgrade Center
- 自组织是管理者和成员的双向奔赴
- [speech signal processing] 3 speech signal visualization -- prosody
- Build yocto system offline for i.mx8mmini development board
- On recursion and Fibonacci sequence
- [20211129] configuration du serveur distant du carnet de notes jupyter
- [datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE
- Sum of factor numbers of interval product -- prefix sum idea + fixed one shift two
- [JS] interview questions
猜你喜欢

Indefinite integral

91. (chapitre Cesium) simulation de lancement de fusées cesium

How to install php7 and perform performance test using yum

One year anniversary of bitbear live studio, hero rally order! I invite you to take a group photo!

MQ-防止消息丢失及重复消费

What are the PHP FPM configuration parameters
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 3](/img/ea/c5e8d12007873385fa0d197fa62fd2.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 3

BIM and safety in road maintenance-buildSmart Spain

Sort out relevant contents of ansible

Interpretation of R & D effectiveness measurement framework
随机推荐
NOV Schedule for . Net to display and organize appointments and recurring events
Typora adds watermarks to automatically uploaded pictures
ASTM D 3801固体塑料垂直燃烧试验
二叉树的链式存储
Build yocto system offline for i.mx8mmini development board
[shell programming] - shell introductory learning
C serialization simple experiment
GID: open vision proposes a comprehensive detection model knowledge distillation | CVPR 2021
Friends day 2022
Sum of factor numbers of interval product -- prefix sum idea + fixed one shift two
JS reverse | m3u8 data decryption of a spring and autumn network
[some notes]
[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE
easyexcel的使用
ASP. Net core 6 from entry to enterprise level practical development application technology summary
Seckill system 03 - redis cache and distributed lock
leetcode 406. Queue reconstruction by height
[datawhale202206] pytorch recommendation system: precision model deepfm & DIN
Virtualenv+pipenv virtual environment management
[datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn




