飞柳浣纱
飞柳浣纱
全部文章
分类
题解(8)
归档
标签
去牛客网
登录
/
注册
飞柳浣纱的博客
全部文章
(共11篇)
题解 | #满足条件的用户的试卷完成数和题目练习数#
select uu.uid, count(distinct a.id) as exam_cnt, count(distinct b.id) as question_cnt from ( select distinct t2.uid from user_info as t1 join exam_rec...
2023-02-06
1
145
题解 | #寻找第K大#
执行结果: 通过 显示详情 添加备注 执行用时:1 ms, 在所有 Java 提交中击...
2022-05-28
0
198
题解 | #链表相加(二)#
三栈数据结构,不精简了,方便阅读 public ListNode addInList(ListNode head1, ListNode head2) {  ...
2022-05-28
0
145
题解 | #二叉树中和为某一值的路径#
二叉树中的回溯 上来就回溯,别问为什么,综合评分也还凑合,贴一下吧 运行时间:16ms超过80.33% 用Java提交的代码占用内存:9736KB超过73.69%用Java提交的代码 public ArrayList<ArrayList<Integer>> FindPath(...
2021-07-26
0
287
题解 | #二叉搜索树的第k个结点#
中序遍历解决树中top K问题 本题就直接用递归来做了 public class Solution { //为什么可以直接获取list中的第k-1个节点,就是所需节点? //题目已经告诉这是一棵二叉搜索树,所以是有序的(根节点的值大于左子树,小于右子树) //在中序遍历中二叉搜索树的遍历结果是从小到...
2021-07-23
0
255
题解 | #把二叉树打印成多行#
二叉树的层序打印 ArrayList<ArrayList<Integer>> Print(TreeNode pRoot) { ArrayList<ArrayList<Integer>> result = new ArrayList<...
2021-07-23
0
274
题解 | #树的子结构#
树的子结构 递归解决 public class Solution { public boolean HasSubtree(TreeNode root1,TreeNode root2) { //这个主要是用来定位大树中节点位置的,便于与子树的头节点对应...
2021-07-22
0
306
题解 | #剪绳子#
动态规划解决剪绳子问题 有思路和解释 ``` public int cuttingRope(int n){ if (n<4) return n-1;//小于4的直接返回n-1 int[] dp = new int[n+1]; //初始化 dp[1] = 0; ...
2021-07-21
0
414
题解 | #把字符串转换成整数#
比较简单的字符串转换 if(str == null) return 0; if (str.charAt(0) >= 'a' && str.charAt(0) <= 'Z' ) return 0; boolean isNega...
2021-07-20
0
315
题解 | #最小的K个数#
top K 问题 大顶堆AC了,没什么难度 ArrayList<Integer> res = new ArrayList<>(); if (input.length == 0) return res; input = creat...
top
2021-07-20
0
288
首页
上一页
1
2
下一页
末页