上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 41 下一页
摘要: 单调栈做法 42. 接雨水 public class mylist { public static int trap(int[] height) { int lens = height.length; // 形成凹槽至少需要三个圆柱,少于三个无法实现 if(lens<=2) return 0; // 阅读全文
posted @ 2023-04-20 10:21 Chenyi_li 阅读(25) 评论(0) 推荐(0)
摘要: 739. 每日温度 java在这里实现的时候用的是LinkedList,所以个人感觉这里与其叫单调栈不如叫单调队列。 注意区分LinkedList的add和push方法。 顺便温习一下集合的关系 class Solution { public int[] dailyTemperatures(int[ 阅读全文
posted @ 2023-04-19 16:59 Chenyi_li 阅读(15) 评论(0) 推荐(0)
摘要: 设计单调栈 class Solution { class MyQueue{ Deque<Integer> deque = new LinkedList<>(); // 弹出元素时,比较当前要弹出的数值是否等于队列出口的数值,如果相等则弹出 public void poll(int val){ if( 阅读全文
posted @ 2023-04-17 21:32 Chenyi_li 阅读(22) 评论(0) 推荐(0)
摘要: 链接:https://leetcode.cn/problem-list/2cktkvj/ 阅读全文
posted @ 2023-04-16 20:40 Chenyi_li 阅读(67) 评论(0) 推荐(0)
摘要: 泛型擦除是指在Java编译器将泛型代码编译成字节码时,将类型擦除成它们原始的类型或者它们的上界限制,从而在运行时无法获得泛型参数的具体类型信息。泛型擦除的主要原因是为了保持泛型代码与非泛型代码之间的兼容性。 类型擦除和多态发生了冲突,为了解决这个问题编译器会产生一个桥方法。在虚拟机中会由参数和返回值 阅读全文
posted @ 2023-04-14 16:24 Chenyi_li 阅读(24) 评论(0) 推荐(0)
摘要: 转载:https://zhuanlan.zhihu.com/p/522852666 阅读全文
posted @ 2023-04-09 10:34 Chenyi_li 阅读(11) 评论(0) 推荐(0)
摘要: 原子性针对的是事务,锁针对的是线程。 转载:https://blog.csdn.net/qq_45714272/article/details/128632144 https://blog.csdn.net/giveupgivedown/article/details/128723748 http: 阅读全文
posted @ 2023-04-07 13:49 Chenyi_li 阅读(188) 评论(0) 推荐(0)
摘要: 面试可能 考的是0-1背包和完全背包问题。 ## 概述 ![](https://img2023.cnblogs.com/blog/1892439/202306/1892439-20230601155140171-1650254038.png) ## 0-1背包 ![](https://img2023 阅读全文
posted @ 2023-04-07 11:14 Chenyi_li 阅读(28) 评论(0) 推荐(0)
摘要: public class Main { public static void main(String[] args) { int a = 12, b = 18; int gcd = gcd(a, b); int lcm = lcm(a, b); System.out.println("最大公因数:" 阅读全文
posted @ 2023-04-06 20:05 Chenyi_li 阅读(35) 评论(0) 推荐(0)
摘要: 参考:https://blog.csdn.net/m0_56079407/article/details/128068680?spm=1001.2014.3001.5502 阅读全文
posted @ 2023-04-05 20:33 Chenyi_li 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 41 下一页