- 博客(17)
- 收藏
- 关注
原创 【maven】无法下载源码时cannot download sources
直接在pom文件目录下terminal中执行:source ~/.bash_profilemvn dependency:resolve -Dclassifier=sources
2022-03-02 15:23:36 2461
原创 【算法】归并排序
#include<bits/stdc++.h>using namespace std; //归并过程void merge(int arr[], int l, int mid, int r){ int help[r-l+1];//辅助数组 int i = 0; int lIndex = l; int rIndex = mid+1; while(lIndex <= mid && rIndex <= r){ help[i++] = arr[lIndex
2022-02-28 14:51:46 1987
原创 【北京工业大学申请个人学生邮箱】
北京工业大学申请个人学生邮箱:由于近期想要购买苹果设备,但是苹果更新了unidays认证,需要用到学生邮箱认证,因此花了几个小时查找北工大的邮箱注册方法,一趟下来,说实在的流程有些阴间,在此进行下记录,也方便后人的查找。一、进入**内网综合服务门户-首页左上角的个人中心**:https://my.bjut.edu.cn/group/graduate/mine二、进入左下角的**账户信息-邮箱开户**:https://my.bjut.edu.cn/group/graduate/-三、按照提
2022-02-11 09:45:24 19378 5
原创 【关闭占用端口的进程】MAC下关闭占用某端口号的进程
以8080为例:1、先查找8080lsof -i:8080会显示:python 85877 yhjin 4u IPv4 0x8c64242f32f23f1f 0t0 TCP localhost:irdmi (LISTEN)2、杀死该端口进程:kill 85877
2022-02-09 00:39:44 2587
原创 【算法】递归回溯:全排列
递归与回溯:46. 全排列//C++版本#include<iostream>#include<vector>using namespace std;// pair<int, int> t(0, 0);vector<int> path;vector<int> path_note(9, 0);vector<vector<int> > res;void traversal(int k, int startIn
2022-02-06 15:27:34 105
原创 【无标题】
递归与回溯:[46. 全排列](https://leetcode-cn.com/problems/permutations/)```c++//C++版本#include<iostream>#include<vector>using namespace std;// pair<int, int> t(0, 0);vector<int> path;vector<int> path_note(9, 0);vector<vect
2022-02-06 14:40:12 6908
原创 【算法】回溯:组合问题(java需要调用复制方法)
回溯:77. 组合在本题中,c++很好理解,但是在书写java的时候有一个需要注意的知识盲区://JavaclassSolution{ publicList<Integer>path=newLinkedList<>(); publicList<List<Integer>>res=newLinkedList<>(); publicList<List<Integer&...
2022-02-05 22:18:04 930
原创 【Mysql】count和case when的使用
SQL34 统计复旦用户8月练题情况selectu.device_id,university,count(qp.question_id)question_cnt,count(casewhenresult='right'then1elsenullend)right_question_cntfromuser_profile uleftjoinquestion_practice_detail qponu.device_id=qp.device_idwhere...
2022-02-02 19:13:08 3468
原创 【Mysql】刷题
SQL33 找出每个学校GPA最低的同学select a.device_id, a.university uni, a.gpa from user_profile a inner join (select min(gpa) min_gpa, university from user_profile group by university) b on a.university = b.university and a.gpa = b.min_gpa order by uni asc;刚开始使用子查询:
2022-02-02 17:50:53 661
原创 【算法】二叉搜索树生成累加树
538. 把二叉搜索树转换为累加树//方法一:直接逆后续遍历。理解了的话,特别好做。classSolution{ TreeNodepre=null; publicTreeNodeconvertBST(TreeNoderoot) { traversal(root); returnroot; } publicvoidtraversal(TreeNoderoot){ if(root...
2022-01-28 09:50:49 145
原创 【算法】删除+修建二叉搜索树
450. 删除二叉搜索树中的节点classSolution{ publicTreeNodedeleteNode(TreeNoderoot,intkey) { root=delete(root,key); returnroot; } publicTreeNodedelete(TreeNoderoot,intkey){ //首先判断root是否为空,为空后续操作会报异常 i...
2022-01-27 14:04:36 268
原创 【Java】在方法中修改引用是不管用的
Java在方法中修改引用是不管用的可以修改传入对象中的值,但是如果直接修改传入对象(即引用),方法是不能修改对象的,除非方法使用返回值的方式将改引用后的对象传回给原对象:nodeleft=gaiYinyong(nodeleft)从下边的代码可以看出,在不修改对象的引用的情况下,修改都是有效的,但是一旦改了引用,之后的对象.属性修改都会无效:publicclasszhengZe{ publicstaticvoidmain(String[]args) {...
2022-01-27 10:31:14 1334
原创 【算法】:二叉搜索树 的 最小差值、众数
二叉搜索树:一大特点是中序遍历为单调递增。530. 二叉搜索树的最小绝对差class Solution { int Min = 2147483647; TreeNode pre; public int getMinimumDifference(TreeNode root) { Compose(root); return Min; } public void Compose(TreeNode root){ if...
2022-01-25 21:32:20 194
原创 【算法】细品迭代法之「合并两个二叉树」与「对称二叉树的判断」
细品迭代法之「合并两个二叉树」与「对称二叉树的判断」101. 对称二叉树classSolution{ publicbooleanisSymmetric(TreeNoderoot){ if(root==null) returntrue; Queue<TreeNode>que=newLinkedList<>(); que.add(root.left); ...
2022-01-23 01:48:45 343
原创 【算法】中序与后序遍历序列构造二叉树(二叉树、递归)
106. 从中序与后序遍历序列构造二叉树根据一棵树的中序遍历与后序遍历构造二叉树。注意:你可以假设树中没有重复的元素。例如,给出中序遍历 inorder = [9,3,15,20,7],后序遍历 postorder = [9,15,7,20,3]返回如下的二叉树:3 / \ 9 20 / \ 15 7classSolution{ publicTreeNodebuildTree(int[]inorder,int[]p...
2022-01-21 00:25:08 1347
原创 【idea】找不到或无法加载主类
shi'yongshi'yonshi'yoshi'yshi引用:yin'yongyin'yonyin'yoyin'yyinyiyIDEA 错误 找不到或无法加载主类(完美解决)_天天开心鸭!-CSDN博客_找不到或无法加载主类ss'h使用此方法后依然无法接发掘,但是在import project后,并且rebuild project后解决了问题。...
2022-01-19 10:14:15 165
原创 【Spring】注解
1、P_C命名空间:配置文件:xmlns:p="http://www.springframework.org/schema/p" xmlns:c="http://www.springframework.org/schema/c"P-namespace:<!-- p命名空间注入 ,可以直接注入属性的值 :property --> <bean id="user" class="com.qin.pojo.User" p:name="秦小东" p:age="18"/&g...
2022-01-18 10:35:26 143
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人