当前位置:网站首页>Double pointer Foundation
Double pointer Foundation
2022-07-05 05:16:00 【lee2813】
One 、 Double pointer
Double pointers are mainly used to traverse arrays , Two pointers point to different elements , Work together , Generally speaking, they are all in the same array .
Two 、 classification
According to the different problems , The direction of movement of the pointer will also be different , It can be divided into two situations :
- Traversal direction is the same and will not intersect
This kind of situation is generally used to solve the problem of searching a certain interval of the array , Also known as the sliding window problem . - The traversal direction is opposite and the array itself is orderly
This situation is generally used for element search
Applications can be divided into :
- Two number sum problem
- Merge two ordered arrays
- Speed pointer problem
- Sliding window problem
3、 ... and 、 A basic review of pointers
- const Heel int, Value cannot be changed , Pointer can be changed
const int * p2 = &x
- const Followed by a pointer p3 front , Value can be changed , The pointer cannot be changed
int * const p3 = &x
- const Heel int And a pointer p4, Value can be changed , The pointer cannot be changed
const int * const p4 = &x
*
Left Union , Therefore, it is a function whose return type is pointer
int * function(){
}
( )
hold*
Included , Andfunction
combination , Therefore, it is return ; Pointer of type function
int func2(int a,int b){
}
int (*function)(int,int) = func2;
边栏推荐
- Basic knowledge points of dictionary
- PMP考生,请查收7月PMP考试注意事项
- Redis has four methods for checking big keys, which are necessary for optimization
- [LeetCode] 整数反转【7】
- [转]MySQL操作实战(一):关键字 & 函数
- BUUCTF MISC
- Do a small pressure test with JMeter tool
- stm32Cubemx(8):RTC和RTC唤醒中断
- Embedded database development programming (VI) -- C API
- TF-A中的工具介绍
猜你喜欢
嵌入式数据库开发编程(六)——C API
Do a small pressure test with JMeter tool
LeetCode之單詞搜索(回溯法求解)
2022年上半年国家教师资格证考试
Unity ugui source code graphic
Collapse of adjacent vertical outer margins
Recherche de mots pour leetcode (solution rétrospective)
[转]MySQL操作实战(三):表联结
TF-A中的工具介绍
Embedded database development programming (V) -- DQL
随机推荐
2022 / 7 / 1 Résumé de l'étude
嵌入式数据库开发编程(零)
Unity and database
The next key of win generates the timestamp file of the current day
[paper notes] multi goal reinforcement learning: challenging robotics environments and request for research
C # perspective following
[转]MySQL操作实战(一):关键字 & 函数
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
SDEI初探-透过事务看本质
UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
Download xftp7 and xshell7 (official website)
使用命令符关闭笔记本自带键盘命令
Embedded database development programming (VI) -- C API
room数据库的使用
Chinese notes of unit particle system particle effect
Unity shot tracking object
2022年上半年国家教师资格证考试
[轉]: OSGI規範 深入淺出
发现一个很好的 Solon 框架试手的教学视频(Solon,轻量级应用开发框架)
2020-10-27