- 博客(8)
- 资源 (22)
- 收藏
- 关注
原创 LeetCode(263 & 264):丑数 I II Ugly Number I II(Java)
2020.12.30 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 丑数I只需要验证是否为丑数即可,直接将其除净即可。丑数II要求返回指定顺位的丑数,可以采用归并的思想。 用三指针指向下一个需要乘n(n=2/3/5)进行拓展的数字,相当于做一个三路归并。 找出三个指针的最小元素,将指针后移。如果有多组指针的当前值都是min,指针都需要后移,保证 ugly 数组中不会加入重复元素。 传送门:丑数 W
2020-12-30 17:48:35 136
原创 LeetCode(262):行程和用户 Trips and Users(SQL)
2020.12.29 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 传送门:行程和用户 Trips 表中存所有出租车的行程信息。每段行程有唯一键 Id,Client_Id 和 Driver_Id 是 Users 表中 Users_Id 的外键。Status 是枚举类型,枚举成员为 (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’)。
2020-12-29 17:41:31 184
原创 LeetCode(258):各位相加 Add Digits(Java)
2020.12.27 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 智力题 规律很简单:数字为0时,结果为0;数字为9的倍数时,结果为9;其他情况下为除以9的余数。 假设输入的数字是一个5位数字num,则num的各位分别为a、b、c、d、e。 有如下关系:num = a * 10000 + b * 1000 + c * 100 + d * 10 + e 即:num = (a + b + c + d
2020-12-27 20:49:53 154
原创 LeetCode(1292):元素和小于等于阈值的正方形的最大边长 Maximum Side Length of a Square(Java)
2020.12.24 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 原地动态规划 + 前缀和。 遍历每一个位置ij时,将该位的数值置为从该位起左边的1的总个数,例如对于矩阵 [1,1,3,2], [1,1,4,3], [1,2,4,2] 遍历结束后效果为: [1,2,5,7], [1,2,6,9], [1,3,7,9] 为了统计正方形矩阵的面积,可以假定当前位置ij为正方
2020-12-24 16:12:52 188 1
原创 LeetCode(185):部门工资前三高的所有员工 Department Top Three Salaries(SQL)
2020.12.23 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 传送门:部门工资前三高的所有员工 Employee 表包含所有员工信息,每个员工有其对应的工号 Id,姓名 Name,工资 Salary 和部门编号 DepartmentId 。 +----+-------+--------+--------------+ | Id | Name | Salary | DepartmentId |
2020-12-23 19:32:37 227
原创 LeetCode(168):Excel表列名称 Excel Sheet Column Title(Java)
2020.12.21 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 这题实质上是移位进制转换问题。 xi*26^(i-1) + … + x3*26^2 + x2*26^1 + x1*26^0 = n 每次num=n%26可以取出最低位的xi=num,n/=26可以去掉最低位的xi. 但题目每个位的范围是1-26,而不是0-25。因此当num==26时需要进行修正,将n-1是使n不满足26的倍数,再
2020-12-21 16:17:20 176
原创 LeetCode(626):换座位 Exchange Seats(SQL)
2020.12.20 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 传送门:换座位 小美是一所中学的信息科技老师,她有一张 seat 座位表,平时用来储存学生名字和与他们相对应的座位 id。 其中纵列的 id 是连续递增的 小美想改变相邻俩学生的座位。 你能不能帮她写一个 SQL query 来输出小美想要的结果呢? 示例: +---------+---------+ | id | stu
2020-12-20 19:40:56 187
原创 LeetCode(1226):哲学家进餐 The Dining Philosophers(JUC)
2020.12.19 LeetCode 从零单刷个人笔记整理(持续更新) github:https://github.com/ChopinXBP/LeetCode-Babel 传送门:哲学家进餐 Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers. Each philosopher must alt
2020-12-19 20:35:46 475 1
陈越、何钦铭-数据结构作业17:Huffman Codes哈夫曼编码
2018-05-17
陈越、何钦铭-数据结构作业16:Complete Binary Search Tree完全二叉搜索树
2018-05-16
陈越、何钦铭-数据结构作业15:File Transfer并查集
2018-05-16
陈越、何钦铭-数据结构作业13:Root of AVL Tree平衡二叉树的根节点
2018-05-03
陈越、何钦铭-数据结构作业12:是否同一棵二叉搜索树
2018-04-20
陈越、何钦铭-数据结构作业11:Tree Traversals Again二叉树非递归遍历/栈遍历
2018-04-18
陈越、何钦铭-数据结构作业10:List Leaves层次遍历叶节点
2018-04-09
陈越、何钦铭-数据结构作业9:树的同构
2018-04-04
陈越、何钦铭-数据结构作业8:二叉搜索树的操作集
2018-03-28
陈越、何钦铭-数据结构作业7:Pop Sequence出栈序列检验
2018-03-27
陈越、何钦铭-数据结构作业6:Reversing Linked List链表翻转
2018-03-26
陈越、何钦铭-数据结构作业5:一元多项式的乘法与加法运算
2018-03-20
陈越、何钦铭-数据结构作业4:在线查找算法求最大子列和,并返回最大子列和头尾元素
2018-03-18
陈越、何钦铭-数据结构作业3:分治算法求最大子列和
2018-03-18
陈越、何钦铭-数据结构作业3:在线查找算法求最大子列和
2018-03-17
陈越、何钦铭-数据结构作业2:顺序链表合并
2018-03-15
陈越、何钦铭-数据结构作业1:二分查找算法
2018-03-15
《C程序设计语言(第二版)》(中文)
2015-07-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人