今日学习内容
3DGS
跑了昨天母点保护的代码,结果一坨,取消这个方法.
力扣每日一题
构造题.
是一个优先队列的构造题目,亮点是用到了一个懒删除的技巧,可以避免删除操作的复杂度.
题目链接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
class TaskManager { private final Map<Integer, int[]> mp = new HashMap<>();
private final PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> a[0] != b[0] ? b[0] - a[0] : b[1] - a[1]);
public TaskManager(List<List<Integer>> tasks) { for (List<Integer> task : tasks) { add(task.get(0), task.get(1), task.get(2)); } }
public void add(int userId, int taskId, int priority) { mp.put(taskId, new int[]{priority, userId}); pq.offer(new int[]{priority, taskId, userId}); }
public void edit(int taskId, int newPriority) { int userId = mp.get(taskId)[1]; add(userId, taskId, newPriority); }
public void rmv(int taskId) { mp.get(taskId)[0] = -1; }
public int execTop() { while (!pq.isEmpty()) { int[] top = pq.poll(); int priority = top[0], taskId = top[1], userId = top[2]; int[] p = mp.get(taskId); if (p[0] == priority && p[1] == userId) { rmv(taskId); return userId; } } return -1; } }
|
JAVA并发编程篇
10/71 学习中,正在完善笔记.
Redis学习笔记
5/57 学习中,正在完善笔记.
简历制作
大概初版已经差不多了.
项目-TecHub
新增排行榜功能模块,包括排行榜请求参数类、排行榜信息类及其数据传输对象,完善用户活跃信息查询接口,增强系统的排行榜管理能力。同时新增排行榜控制器,支持前端展示活跃用户排行榜。 JakicDong 1 分钟之前
新增站点地图功能模块,包括站点地图实体类、服务接口及实现、控制器,支持生成和刷新sitemap.xml,增强系统的SEO优化能力。同时更新统计服务,增加文章和用户的统计信息查询功能,提升数据统计的准确性和完整性。 JakicDong 19 分钟之前
新增短链接功能模块,包括短链接请求对象、返回对象、数据库实体类、服务接口及实现,以及控制器。实现短链接的创建和获取,支持根据短链接重定向到原始URL,增强系统的链接管理能力。 JakicDong 今天 15:35
项目-派聪明
生活篇