当前位置:网站首页>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 , Andfunctioncombination , Therefore, it is return ; Pointer of type function
int func2(int a,int b){
}
int (*function)(int,int) = func2;

边栏推荐
- Simple HelloWorld color change
- Lua determines whether the current time is the time of the day
- Unity enables mobile phone vibration
- 2020-10-27
- MD5 bypass
- 64 horses, 8 tracks, how many times does it take to find the fastest 4 horses at least
- Programmers' experience of delivering takeout
- Django reports an error when connecting to the database. What is the reason
- Unity ugui source code graphic
- Redis has four methods for checking big keys, which are necessary for optimization
猜你喜欢

Redis has four methods for checking big keys, which are necessary for optimization

Unity get component

669. Prune binary search tree ●●

Data is stored in the form of table

【Leetcode】1352. Product of the last K numbers

Collapse of adjacent vertical outer margins

Ue4/ue5 illusory engine, material part (III), material optimization at different distances
![[turn to] MySQL operation practice (III): table connection](/img/70/20bf9b379ce58761bae9955982a158.png)
[turn to] MySQL operation practice (III): table connection

Magnifying glass effect

UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
随机推荐
Merge sort
十年不用一次的JVM调用
Out and ref functions of unity
《动手学深度学习》学习笔记
一个新的微型ORM开源框架
Unity parallax infinite scrolling background
Download xftp7 and xshell7 (official website)
Bubble sort summary
Download and use of font icons
小程序直播+電商,想做新零售電商就用它吧!
How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
被舆论盯上的蔚来,何时再次“起高楼”?
UE fantasy engine, project structure
3dsmax common commands
2022/7/1學習總結
[转]MySQL操作实战(一):关键字 & 函数
支持多模多态 GBase 8c数据库持续创新重磅升级
2022 / 7 / 1 Résumé de l'étude
Kali 2018 full image download
Solon Logging 插件的添加器级别控制和日志器的级别控制