摘要:
Excel 表列序号 从后往前 乘26 class Solution { public int titleToNumber(String columnTitle) { int len = columnTitle.length(); int num = 0; int res=0; for(int i= 阅读全文
摘要:
股票问题01 121. 买卖股票的最佳时机 - 力扣(Leetcode) class Solution { public int maxProfit(int[] prices) { int minPrice=prices[0]; int maxProfit=0; for(int price:pric 阅读全文
摘要:
环形链表 II 思路:快慢指针 根据,设起点到入点为a,圈为b个节点 f=2s (快指针每次2步,路程刚好2倍) f = s + nb (首次相遇时,刚好多走了n圈) 推出:s = nb,即快指针比慢指针在圈里多走了n圈,这样只需要再走a步即可到达入点 从head结点走到入环点需要走 : a + n 阅读全文
摘要:
1. 滑动窗口 剑指 Offer 30. 包含min函数的栈 /** * 剑指 Offer 30. 包含min函数的栈 */ class minStack { Stack<Integer> A, B; public minStack() { A = new Stack<>(); B = new St 阅读全文
摘要:
内存管理 主要说的内存管理其实是Executor 存储内存:缓存数据 & 广播变量,(总内存-300M) x 60% x 0.5 执行内存:Shuffle过程中的操作,(总内存-300M) x 60% x 0.5 其他内存:系统 & RDD元数据信息,(总内存-300M) x 40% 预留内存:30 阅读全文