当前位置:网站首页>On array replication
On array replication
2022-04-23 08:55:00 【Lion boy】
List of articles
- There are two arrays that have opened up space , You only need to exchange the contents of two arrays ( The essence is to change the pointer of two array names )
- Out of nothing ( There is only one array that has opened up space , It needs to duplicate as like as two peas. , And one of the contents changes , The other doesn't change )
There are two arrays that have opened up space , You only need to exchange the contents of two arrays ( The essence is to change the pointer of two array names )
int[] tem = heapArr[cur];
heapArr[cur] = heapArr[parent];
heapArr[parent]= tem;
Out of nothing ( There is only one array that has opened up space , It needs to duplicate as like as two peas. , And one of the contents changes , The other doesn't change )
It's time to Open up a space , And then use Arrays.copyOf( Array name ( Source array ), How long segments do you want to copy ( Start from the beginning of the array Calculation )) function
for example :
Arrays.copyOf(Array,Array.length)
tem = Arrays.copyOf(heapArr[cur],2);
heapArr[cur] = Arrays.copyOf(heapArr[child],2);
heapArr[child] = Arrays.copyOf(tem,2);
版权声明
本文为[Lion boy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230810298100.html
边栏推荐
- Latex mathematical formula
- Illegal character in scheme name at index 0:
- 四张图弄懂matplotlib的一些基本用法
- Kubernetes如何使用harbor拉去私有镜像
- dataBinding中使用include
- Go语言自学系列 | golang方法
- GUI编程简介 swing
- Go语言自学系列 | golang结构体指针
- Go语言自学系列 | golang结构体作为函数参数
- Notes on 30 steps of introduction to the Internet of things of yangtao electronics STM32 III. cubemx graphical programming and setting the IO port on the development board
猜你喜欢

Summary of solid problems

PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition

Star Trek强势来袭 开启元宇宙虚拟与现实的梦幻联动

2021李宏毅机器学习之Adaptive Learning Rate

PCTP考试经验分享

Idea package jar file

在sqli-liabs学习SQL注入之旅(第十一关~第二十关)

2021 Li Hongyi's adaptive learning rate of machine learning

MySQL small exercise (only suitable for beginners, non beginners are not allowed to enter)

L2-024 部落 (25 分)(并查集)
随机推荐
Go language self-study series | golang nested structure
数字政府建设中政务中台中的技术创新点
LaTeX数学公式
Talent Plan 学习营初体验:交流+坚持 开源协作课程学习的不二路径
L2-024 部落 (25 分)(并查集)
MATLAB 画五星红旗
Notes d'apprentissage oneflow: de functor à opexprinterpreter
LaTeX论文排版操作
Kubernetes如何使用harbor拉去私有镜像
[58] length of the last word [leetcode]
扣缴义务人
LLVM之父Chris Lattner:编译器的黄金时代
Notes on 30 steps of introduction to the Internet of things of yangtao electronics STM32 III. cubemx graphical programming and setting the IO port on the development board
PCTP考试经验分享
【IndexOf】【lastIndexOf】【split】【substring】用法详解
Applet in wechat and app get current ()
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
Pctp test experience sharing
请问中衍期货安全靠谱吗?
Flink同时读取mysql与pgsql程序会卡住且没有日志