1066 Root of AVL Tree (25分) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node diff ...
分类:
其他好文 时间:
2020-06-05 23:18:28
阅读次数:
73
join Thread类 设计一个模型 1.有两个线程 One Two ;Two加入到One里面 2.设计模型的时候 two线程在one的run里面创建 保证两个有先后顺序 3.two.join(); 无参数==0 有参数==2000 synchronized锁 非常的厉害 一旦对象被锁定 不释放的 ...
分类:
编程语言 时间:
2020-06-05 22:48:25
阅读次数:
86
多个 ssh key 配置多个网站 一、生成ssh key ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_one ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_two # 不添加-f 参数 会默认将私钥保存在~/ ...
分类:
其他好文 时间:
2020-06-04 20:05:42
阅读次数:
65
查找file1中每一行是否在file2中,若在输出到InRight.txt, 若不在输出到NotInRight.txt. f1=$1f2=$2 while read mylinedo grepR=`grep $myline $f2` if [[ $grepR != "" ]]; then echo ...
分类:
系统相关 时间:
2020-06-04 14:01:58
阅读次数:
63
题目如下: Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa (i ...
分类:
其他好文 时间:
2020-06-03 23:41:15
阅读次数:
108
There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th p ...
分类:
其他好文 时间:
2020-06-03 23:34:27
阅读次数:
72
题目如下: You are given an integer num. You will apply the following steps exactly two times: Pick a digit x (0 <= x <= 9). Pick another digit y (0 <= y < ...
分类:
其他好文 时间:
2020-06-03 23:33:43
阅读次数:
70
题目如下: Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and r ...
分类:
其他好文 时间:
2020-06-01 18:02:06
阅读次数:
65
题目描述 leetcode - 1:https://leetcode-cn.com/problems/two-sum/ 解题关键 hashmap的使用 碎碎念 题目比较简单,暴力过很容易,不过借助hash可以降低时间复杂度,但是增加了空间的消耗。学习了hashmap的使用 key:value 定义 ...
分类:
其他好文 时间:
2020-06-01 01:06:46
阅读次数:
77
使用了long。没有解决int的溢出问题。 class Solution { public: int divide(int dividend, int divisor) { //if (dividend == 0) return 0; //if (divisor == 1) return divid ...
分类:
其他好文 时间:
2020-05-31 18:17:56
阅读次数:
101