Skip to content

[pull] master from greyireland:master #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6259857
add c++ code
binzi56 Jul 30, 2020
2741c8c
Merge pull request #27 from binzi56/hotfix_new
greyireland Aug 3, 2020
4b2f02f
👌 IMPROVE: optimize the reverse function
promacanthus Aug 11, 2020
c297b60
🐛 FIX: expression display error
promacanthus Aug 11, 2020
5c92114
🐛 FIX: comment error
promacanthus Aug 11, 2020
ab5c884
👌 IMPROVE: use bit operations faster
promacanthus Aug 11, 2020
aecf156
👌 IMPROVE:
promacanthus Aug 11, 2020
80a0851
Revert "👌 IMPROVE:"
promacanthus Aug 12, 2020
158486d
Revert "👌 IMPROVE: use bit operations faster"
promacanthus Aug 12, 2020
578c077
Merge pull request #30 from Promacanthus/improve
greyireland Aug 14, 2020
d017eac
添加swift版本
easyui Sep 16, 2020
5e524d2
Merge pull request #32 from easyui/master
greyireland Sep 20, 2020
7c59d9d
Update README.md
lvseouren Mar 10, 2021
0c6abaf
Merge pull request #36 from lvseouren/master
greyireland Mar 10, 2021
f2909c6
Update sort.md
chienmy Mar 26, 2021
caa8928
Update README.md
chienmy Mar 26, 2021
8c74545
Merge pull request #39 from chienmy/master
greyireland Mar 26, 2021
a445d07
update README.md
ligecarryme May 13, 2021
f6931f0
Merge pull request #42 from ligecarryme/master
greyireland May 14, 2021
1a004aa
Create LICENSE
greyireland Jan 21, 2023
5077f53
Merge pull request #52 from greyireland/add-license-1
greyireland Jan 21, 2023
7d09360
add dart code
ayaseeri Mar 9, 2023
cb6baba
Merge pull request #54 from Esdeath/master
greyireland May 28, 2023
f367ce3
Update README.md
longpi1 Dec 9, 2023
b07040b
Merge pull request #59 from longpi1/patch-1
greyireland Dec 14, 2023
9660de9
add csharp code
tpxxn Dec 22, 2023
0a8d0cf
Merge pull request #60 from tpxxn/master
greyireland Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 greyireland

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,13 @@

| 完成 | 用户 | 项目地址 |
| ---- | ------------------------------------------------- | ------------------------------------------------------------------- |
| ✅ | [easyui](https://github.com/easyui/) | [algorithm-pattern-swift(Swift 实现)](https://github.com/easyui/algorithm-pattern-swift),[在线文档 Gitbook](https://zyj.gitbook.io/algorithm-pattern-swift/) |
| ✅ | [wardseptember](https://github.com/wardseptember) | [notes(Java 实现)](https://github.com/wardseptember/notes) |
| ✅ | [dashidhy](https://github.com/dashidhy) | [algorithm-pattern-python(Python 实现)](https://github.com/dashidhy/algorithm-pattern-python) |
| ✅ | [binzi56](https://github.com/binzi56) | [algorithm-pattern-c(c++ 实现)](https://github.com/binzi56/algorithm-pattern-c) |
| ✅ | [lvseouren](https://github.com/lvseouren) | [algorithm-study-record(c++ 实现)](https://github.com/lvseouren/algorithm-study-record) |
| ✅ | [chienmy](https://github.com/chienmy) | [algorithm-pattern-java(Java 实现)](https://github.com/chienmy/algorithm-pattern-java), [在线文档 Gitbook](https://chienmy.gitbook.io/algorithm-pattern-java/) |
| ✅ | [ligecarryme](https://github.com/ligecarryme) | [algorithm-pattern-JavaScript(JS+TS实现)](https://github.com/ligecarryme/algorithm-pattern-JavaScript) |
| ✅ | [Esdeath](https://github.com/Esdeath) | [algorithm-pattern-dart(dart实现)](https://github.com/Esdeath/algorithm-pattern-dart),[在线文档 Gitbook](https://ayaseeri.gitbook.io/algorithm-pattern-dart/) |
| ✅ | [longpi1](https://github.com/longpi1) | [algorithm-pattern-golang(golang实现)](https://github.com/longpi1/algorithm-pattern)
| ✅ | [tpxxn](https://github.com/tpxxn) | [algorithm-pattern-CSharp(C# 实现)](https://github.com/tpxxn/algorithm-pattern-CSharp)
4 changes: 2 additions & 2 deletions basic_algorithm/sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ func sink(a []int, i int, length int) {
for {
// 左节点索引(从0开始,所以左节点为i*2+1)
l := i*2 + 1
// 有节点索引
// 右节点索引
r := i*2 + 2
// idx保存根、左、右三者之间较大值的索引
idx := i
// 存在左节点,左节点值较大,则取左节点
if l < length && a[l] > a[idx] {
idx = l
}
// 存在有节点,且值较大,取右节点
// 存在右节点,且值较大,取右节点
if r < length && a[r] > a[idx] {
idx = r
}
Expand Down
4 changes: 1 addition & 3 deletions data_structure/binary_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,7 @@ func zigzagLevelOrder(root *TreeNode) [][]int {
}
func reverse(nums []int) {
for i := 0; i < len(nums)/2; i++ {
t := nums[i]
nums[i] = nums[len(nums)-1-i]
nums[len(nums)-1-i] = t
nums[i], nums[len(nums)-1-i] = nums[len(nums)-1-i], nums[i]
}
}
```
Expand Down
7 changes: 4 additions & 3 deletions data_structure/stack_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ func (this *MinStack) GetMin() int {

[evaluate-reverse-polish-notation](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/)

> **波兰表达式计算** > **输入:** ["2", "1", "+", "3", "*"] > **输出:** 9
> **解释:** ((2 + 1) \* 3) = 9
> **波兰表达式计算** > **输入:** `["2", "1", "+", "3", "*"]` > **输出:** 9
>
> **解释:** `((2 + 1) * 3) = 9`

思路:通过栈保存原来的元素,遇到表达式弹出运算,再推入结果,重复这个过程

Expand All @@ -100,7 +101,7 @@ func evalRPN(tokens []string) int {
if len(stack)<2{
return -1
}
// 注意:a为除数,b为被除数
// 注意:a为被除数,b为除数
b:=stack[len(stack)-1]
a:=stack[len(stack)-2]
stack=stack[:len(stack)-2]
Expand Down