03 2022 档案

摘要:题目解析: 单链表 A.next->B B.next->C C.next->D D.next->E A->B->C->D->E 反转后 E->D->C->B->A 手动反转 1、B.next=A 2、C.next=B 3、D.next=C 4、E.next=D 5、A.next=null 6、返回E 阅读全文
posted @ 2022-03-04 12:07 gabin 阅读(65) 评论(0) 推荐(0)
摘要:1、什么叫局部最小值 局部指的是左 中 右 最小值,自然是三个值做比较取最小了 边界场景:索引0和索引1,这个场景下,如果是判断索引0位置是否最小值的话,此时只需要2个数相比。同理,最后一个数组元素也是2值相比 2、这道算法题其实还有个前提,就是相邻数不等,也就是说,不会出现 1 2 2这样的数组 阅读全文
posted @ 2022-03-02 14:40 gabin 阅读(262) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { for (int i = 0; i < 10; i++) { test(); } } private static void test() { // 1、获取一个有序数组 int i = ThreadLocalRand 阅读全文
posted @ 2022-03-02 12:14 gabin 阅读(103) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { for (int i = 0; i < 10; i++) { test(); } } private static void test() { // 1、获取一个有序数组 int i = ThreadLocalRand 阅读全文
posted @ 2022-03-02 09:56 gabin 阅读(138) 评论(0) 推荐(0)