Skip to content

Commit 6648ba5

Browse files
committed
no message
1 parent 02ae094 commit 6648ba5

3 files changed

Lines changed: 80 additions & 16 deletions

File tree

‎history/pics_tag.md‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66

77
<div align="center"> <img src="../pics/hash-to-badlink.png" width=""/></div><br/>
88

9+
<div align="center"> <img src="pics/LCS.png" width=""/></div><br/>
910

1011

1112

1213

1314
## 2. 段首空格
1415

1516

16-
这里开始是我的正文内容...
17-
18-
19-
20-
21-
22-
17+
这里开始是我的正文内容...

‎interview/大厂之路.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
## :rocket:目标大厂
42

53
| 序号 | 公司 | 时间 | 笔试 | 城市 | 岗位 | 官网 |

‎notes/数据结构与算法.md‎

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
[TOC]
41
<!-- TOC -->
52

63
- [前言](#前言)
@@ -63,7 +60,7 @@
6360

6461
## 三、树和二叉树
6562

66-
###红黑树
63+
###1. 红黑树
6764

6865
红黑树的特性:
6966

@@ -87,6 +84,16 @@ https://github.com/CarpenterLee/JCFInternals/blob/049c84bb65a3114ba4b8355d83c490
8784

8885

8986

87+
### 2. 二叉树
88+
89+
90+
91+
### 3. AVL树
92+
93+
94+
95+
### 4. B和B+
96+
9097

9198

9299
## 四、字符串和数组
@@ -688,7 +695,9 @@ public class HeapSort {
688695

689696

690697

691-
### ★ 排序算法总结
698+
699+
700+
### 9. 排序算法总结
692701

693702
| | 平均时间复杂度 | 原地排序 | 额外空间 | 稳定排序 |
694703
| :------: | :------------: | :------: | :------: | :------: |
@@ -1229,9 +1238,71 @@ public class Solution3 {
12291238

12301239
## 四、贪心算法
12311240

1241+
### 1. assign-cookies
12321242

1243+
假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。对每个孩子 i ,都有一个胃口值 gi ,这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j ,都有一个尺寸 sj 。如果 sj >= gi ,我们可以将这个饼干 j 分配给孩子 i ,这个孩子会得到满足。你的目标是尽可能满足越多数量的孩子,并输出这个最大数值。
1244+
1245+
**注意:**
1246+
1247+
你可以假设胃口值为正。
1248+
一个小朋友最多只能拥有一块饼干。
1249+
1250+
**示例 1:**
1251+
1252+
```
1253+
输入: [1,2,3], [1,1]
1254+
1255+
输出: 1
1256+
1257+
解释:
1258+
你有三个孩子和两块小饼干,3个孩子的胃口值分别是:1,2,3。
1259+
虽然你有两块小饼干,由于他们的尺寸都是1,你只能让胃口值是1的孩子满足。
1260+
所以你应该输出1。
1261+
```
1262+
1263+
**示例 2:**
1264+
1265+
```
1266+
输入: [1,2], [1,2,3]
12331267
1268+
输出: 2
12341269
1270+
解释:
1271+
你有两个孩子和三块小饼干,2个孩子的胃口值分别是1,2。
1272+
你拥有的饼干数量和尺寸都足以让所有孩子满足。
1273+
所以你应该输出2.
1274+
```
1275+
1276+
1277+
1278+
```java
1279+
public class Solution {
1280+
1281+
public int findContentChildren(int[] g, int[] s) {
1282+
int res = 0;
1283+
Arrays.sort(g);
1284+
Arrays.sort(s);
1285+
1286+
for (int i = g.length - 1; i >= 0; i--) {
1287+
for (int j = s.length - 1; j >= 0; j--) {
1288+
if(s[j] >= g[i]){
1289+
res ++;
1290+
s[j] = 0;
1291+
break;
1292+
}
1293+
}
1294+
}
1295+
1296+
return res;
1297+
}
1298+
1299+
1300+
public static void main(String[] args) {
1301+
int res = new Solution().findContentChildren(new int[]{1,2,3}, new int[]{3});
1302+
System.out.println(res);
1303+
}
1304+
}
1305+
```
12351306

12361307

12371308

@@ -1245,7 +1316,7 @@ public class Solution3 {
12451316

12461317

12471318

1248-
# 面试指南
1319+
# 第三部分:面试指南
12491320

12501321
## 阿里面经OneNote
12511322

@@ -1265,7 +1336,7 @@ public class Solution3 {
12651336

12661337

12671338

1268-
# 参考资料
1339+
# 第四部分:参考资料
12691340

12701341
- [数据结构与算法系列 目录 - 如果天空不死 - 博客园](http://www.cnblogs.com/skywang12345/p/3603935.html)
12711342

0 commit comments

Comments
 (0)