Skip to content

Commit 1026a60

Browse files
author
suochenfeng
committed
Merge remote-tracking branch 'upstream/master'
2 parents 73109b4 + d5bca6f commit 1026a60

File tree

746 files changed

+26660
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

746 files changed

+26660
-99
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 极客大学「算法训练营第四期 - 1 班」作业提交仓库
22

3+
请大家通过该链接查看讲师课件并进行下载: https://pan.baidu.com/s/1k1BHhltBkZLJw0TG-uYC7g 密码:p5op
34

45
## 仓库目录结构说明
56

Utils/.idea/Utils.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Utils/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Utils/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Utils/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Utils/.idea/workspace.xml

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Utils/git_quick_guide.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Environment Setup
2+
-----------------
3+
4+
### Git Download
5+
```
6+
Download Git according to Windows, Linux, Mac
7+
```
8+
9+
### Git global setup
10+
11+
```
12+
git config --global user.name "Your Name"
13+
git config --global user.email "youremail@xxx"
14+
```
15+
16+
### Add public key
17+
18+
* Add your public key
19+
Note: [Here](https://help.github.com/enterprise/2.15/user/articles/connecting-to-github-with-ssh) is the document about how to add the ssh key.
20+
21+
22+
Workflow with git
23+
-----------------
24+
25+
26+
### Prepare
27+
28+
* Open (https://github.com/algorithm004-01/algorithm004-01) in your browser, and click "Fork", choose your own namespace.
29+
30+
* Clone repo:
31+
32+
```
33+
git clone https://github.com/your_namespace/algorithm004-01.git
34+
or
35+
git clone git@github.com:your_namespace/algorithm004-01.git
36+
```
37+
38+
### Before developing a new homework
39+
40+
1. Choose the base branch on group fork
41+
42+
```
43+
git checkout master
44+
```
45+
2. Write your own code
46+
47+
48+
### After developing
49+
50+
1. Commit your changes in local repo.
51+
52+
```
53+
git add /path/to/files/you/changed
54+
git commit -m 'XXX submit xx homework code'
55+
```
56+
57+
58+
### Merge your changes to `algorithm004-01/algorithm004-01`
59+
60+
1. Push local commits to `your_namespace/algorithm004-01:mastr` in GitHub:
61+
62+
```
63+
git push origin master
64+
```
65+
66+
2. Create pull request from XXX to `algorithm004-01/algorithm004-01:master`
67+
![step1](https://github.com/honeyaya/algorithm004-01/blob/master/Utils/pr1.png)
68+
![step2](https://github.com/honeyaya/algorithm004-01/blob/master/Utils/pr2.png)
69+
70+
71+
72+
73+
Appendix
74+
--------
75+
76+
More Git Tutorial:
77+
- https://www.liaoxuefeng.com/wiki/896043488029600
78+
- 极客时间的git课程
79+

Utils/pr1.png

43.1 KB
Loading

Utils/pr2.png

47.2 KB
Loading

Week 01/id_006/DequeDemo.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.mrglint.leetcode;
2+
3+
import java.util.Deque;
4+
import java.util.LinkedList;
5+
6+
/**
7+
* @author luhuancheng
8+
* @since 2019-10-20 10:34
9+
*/
10+
public class DequeDemo {
11+
public static void main(String[] args) {
12+
// 一个使用链表实现的无界双端队列
13+
Deque<String> deque = new LinkedList<>();
14+
15+
// 从头部入队
16+
deque.addFirst("a");
17+
deque.addFirst("b");
18+
deque.addFirst("c");
19+
System.out.println(deque);
20+
21+
// 从尾部入队
22+
deque.addLast("a");
23+
deque.addLast("b");
24+
deque.addLast("c");
25+
System.out.println(deque);
26+
27+
String str = deque.peek();
28+
System.out.println(str);
29+
System.out.println(deque);
30+
31+
while (deque.size() > 0) {
32+
// 从头部出队
33+
System.out.println(deque.removeFirst());
34+
}
35+
36+
System.out.println(deque);
37+
}
38+
}
39+

0 commit comments

Comments
 (0)