摘要:
import java.time.LocalDateTime; import java.util.Arrays; import java.util.Random; /** * @desc 插入排序 * 思路分析: * (1)把n个待排序的元素看成为一个有序表和一个无序表,开始时有序表只包含一个元素, 阅读全文
posted @ 2020-08-08 13:48
浮云7
阅读(74)
评论(0)
推荐(0)
摘要:
import java.util.Arrays; /** * @desc 冒泡排序 * 案例:arr[] = {3, 9, -1, 10, 20} * 思路分析: * 1.两层for循环遍历待排序的数组,i的index=[0,arr.length-1],j的index=[0,arr.length-1 阅读全文
posted @ 2020-08-08 13:44
浮云7
阅读(59)
评论(0)
推荐(0)
摘要:
/** * @desc 线性查找 * 案例: * {1, 8, 10, 89, 1000, 1234} */ public class OrderSearch { public static void main(String[] args) { int[] arr = {1, 8, 10, 89, 阅读全文
posted @ 2020-08-08 13:42
浮云7
阅读(45)
评论(0)
推荐(0)

浙公网安备 33010602011771号