当前位置:网站首页>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
边栏推荐
- Brief steps to build a website / application using flash and H5
- Automatic differentiation and higher order derivative in deep learning framework
- Star Trek's strong attack opens the dream linkage between metacosmic virtual reality
- Use include in databinding
- MySQL小練習(僅適合初學者,非初學者勿進)
- 调包求得每个样本的k个邻居
- Error: cannot find or load main class
- Cadence process angle simulation, Monte Carlo simulation, PSRR
- Go语言自学系列 | golang嵌套结构体
- [58] length of the last word [leetcode]
猜你喜欢

请提前布局 Star Trek突破链游全新玩法,市场热度持续高涨

资源打包关系依赖树

LaTeX论文排版操作

STM32 uses Hal library. The overall structure and function principle are introduced

The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution

GUI编程简介 swing

MySQL小练习(仅适合初学者,非初学者勿进)

1099 establish binary search tree (30 points)

Non duplicate data values of two MySQL query tables

Redis Desktop Manager for Mac(Redis可视化工具)
随机推荐
Withholding agent
还原二叉树 (25 分)
L2-023 graph coloring problem (25 points) (graph traversal)
The K neighbors of each sample are obtained by packet switching
Error: cannot find or load main class
Bk3633 specification
MySQL小練習(僅適合初學者,非初學者勿進)
汇编语言与逆向工程 栈溢出漏洞逆向分析实验报告
Idea is configured to connect to the remote database mysql, or Navicat fails to connect to the remote database (solved)
[indexof] [lastIndexOf] [split] [substring] usage details
四张图弄懂matplotlib的一些基本用法
Go语言自学系列 | golang结构体的初始化
Valgrind et kcachegrind utilisent l'analyse d'exécution
Learn SQL injection in sqli liabs (Level 11 ~ level 20)
Yangtao electronic STM32 Internet of things introduction 30 steps notes 1. The difference between Hal library and standard library
Use of Arthas in JVM tools
2022-04-22 OpenEBS云原生存储
Kubernetes如何使用harbor拉去私有镜像
Strength comparison vulnerability of PHP based on hash algorithm
Complete binary search tree (30 points)