Files
Hui-s-notebook/logseq-java/journals/2022_04_06.md
2024-02-02 00:12:49 +08:00

29 lines
890 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- [[面向对象]]
- [[类和对象的创建]]
- [[数组排序]]
- [[数组内存分析]]
-
-
-
-
-
-
- 总结
collapsed:: true
- 数组的排序
- 获取数组的最值
- 定义最值为数组第一个for循环遍历比较使用中间变量交换最值
- 查询数组中的元素
- 数组反转
- 交换元素中从头开始和从尾开始对应的元素
- 冒泡排序
- 两两比较,并交换位置
- 选择排序
- 通过比较确定最值的下标,并在比较结束后交换最值的位置
- 数组内存分析
- 数组内存
- 数组为自定义变量,在栈中存储的是内存中的地址
- 当给一个数组重新定义时,会改变栈中指向堆中的地址,原来的数据失去引用会被回收
- 常见错误
- 下标越界:下标超出程序中数组的下标范围
- 空指针:数组没有具体存储空间