摘要: # HashSet ``` contains add ``` # Stack ``` empty peek pop push(add) size ``` # HashMap ``` map.keySet() valueOf(value) get(key), put(key, value), isEm 阅读全文
posted @ 2023-04-24 18:34 你在学什么 阅读(15) 评论(0) 推荐(0) 编辑
摘要: # Bean生命周期步骤详情 * UserService -> 推断构造方法 -> 普通对象 -> 依赖注入(给对象赋值) -> 初始化前(@PostConstruct) -> 初始化(afterPropertiesSet()) -> 初始化后(AOP) -> 代理对象 ->Map : 单例池 Be 阅读全文
posted @ 2023-05-15 14:16 你在学什么 阅读(12) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/m0_45406092/article/details/118185561 阅读全文
posted @ 2023-05-14 17:12 你在学什么 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 每日温度 链接 class Solution { public int[] dailyTemperatures(int[] temperatures) { int n = temperatures.length; int[] res = new int[n]; Deque<Integer> stac 阅读全文
posted @ 2023-05-13 22:05 你在学什么 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 数组中第k个最大元素 链接 class Solution { public int findKthLargest(int[] nums, int k) { PriorityQueue<Integer> q = new PriorityQueue<Integer>(k, new Comparator< 阅读全文
posted @ 2023-05-11 10:17 你在学什么 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 寻找重复数 寻找重复数 class Solution { public int findDuplicate(int[] nums) { int len = nums.length; int l = 1, r = len - 1; while (l < r) { int mid = (l + r) / 阅读全文
posted @ 2023-05-10 11:31 你在学什么 阅读(69) 评论(0) 推荐(0) 编辑
摘要: # 共享内存(不使用锁) ``` class test { private static int count = 0; public static void main(String[] args) { Thread t1 = new MyThread(0); Thread t2 = new MyTh 阅读全文
posted @ 2023-05-09 22:07 你在学什么 阅读(55) 评论(0) 推荐(0) 编辑
摘要: class LRUCache { int capacity; Map<Integer, Integer> map; public LRUCache(int capacity) { this.capacity = capacity; map = new LinkedHashMap<>(); } pub 阅读全文
posted @ 2023-05-05 15:30 你在学什么 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 背包 背包01 01背包 代码块 int dp[1004][1004], v[1004], w[1004]; int main() { int n, m; cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> v[i] >> w[i]; } for 阅读全文
posted @ 2022-11-18 00:36 你在学什么 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 试除法判定质数 bool is_prime(int x) { if (x < 2) return false; for (int i = 2; i <= x / i; i ++ ) if (x % i == 0) return false; return true; } 试除法分解质因数 void 阅读全文
posted @ 2022-11-17 22:18 你在学什么 阅读(245) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示