Skip to content
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

更改面试题5 替换空格算法 #17

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
002c2e2
更改面试题5 替换空格算法
Einstellung May 4, 2019
34c193c
更新面试题4指向的URL
Einstellung May 4, 2019
a72bd74
Update README.md
Einstellung May 4, 2019
2743c34
增加递归调用实现
Einstellung May 5, 2019
0d1d4e0
Merge branch 'master' of github.com:Einstellung/AlgorithmsByPython
Einstellung May 5, 2019
a65850e
修改面试题5指向链接
Einstellung May 5, 2019
7df60c9
添加新题更改一下排序
Einstellung May 6, 2019
7a518a9
更改二叉树下一个节点代码
Einstellung May 6, 2019
4c8aef5
添加第八题代码索引
Einstellung May 6, 2019
5ef63c6
更改两个队列实现栈,代码更简洁
Einstellung May 6, 2019
15659b2
Merge branch 'master' of github.com:Einstellung/AlgorithmsByPython
Einstellung May 6, 2019
d3eeb41
更改两个队列实现栈指向链接
Einstellung May 7, 2019
7f6ac1b
菲波那切数列代码调整
Einstellung May 7, 2019
4128e5f
Update README.md
Einstellung May 7, 2019
0ca4d3a
Merge branch 'master' of github.com:Einstellung/AlgorithmsByPython
Einstellung May 7, 2019
734b0d1
Update README.md
Einstellung May 7, 2019
50edaf6
添加矩形覆盖问题指向链接
Einstellung May 9, 2019
101fdd2
更改代码,快排算法变得更简洁
Einstellung May 12, 2019
244bc06
Merge branch 'master' of github.com:Einstellung/AlgorithmsByPython
Einstellung May 12, 2019
caa155e
更改快排指向链接
Einstellung May 12, 2019
4d25c56
更改旋转数组最小数字,代码更简洁
Einstellung May 14, 2019
954f541
更改第11题指向链接
Einstellung May 15, 2019
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@

[面试题9:用两个栈实现队列](https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/master/Target%20Offer/%E7%94%A8%E4%B8%A4%E4%B8%AA%E6%A0%88%E5%AE%9E%E7%8E%B0%E9%98%9F%E5%88%97.py):需要两个栈Stack1和Stack2,push的时候直接push进Stack1。pop需要判断Stack1和Stack2中元素的情况,Stack1空的话,直接从Stack2 pop,Stack1不空的话,把Stack1的元素push进入Stack2,然后pop Stack2的值。[推广:用两个队列实现栈](https://github.com/Einstellung/AlgorithmsByPython/blob/master/Target%20Offer/%E7%94%A8%E4%B8%A4%E4%B8%AA%E9%98%9F%E5%88%97%E5%AE%9E%E7%8E%B0%E6%A0%88.py)

[面试题10:斐波那契数列](https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/master/Target%20Offer/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97.py):如何不使用递归实现斐波那契数列,需要把前面两个数字存入在一个数组中。斐波那契数列的变形有很多,如青蛙跳台阶,一次跳一个或者两个;铺瓷砖问题。**变态青蛙跳**,每次至少跳一个,至多跳n个,一共有f(n)=2<sup>n-1</sup>种跳法。考察数学建模的能力。
[面试题10:斐波那契数列](https://github.com/Einstellung/AlgorithmsByPython/blob/master/Target%20Offer/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97.py):如何不使用递归实现斐波那契数列,需要把前面两个数字存入在一个数组中。斐波那契数列的变形有很多,如[青蛙跳台阶](https://github.com/Einstellung/AlgorithmsByPython/blob/master/Target%20Offer/%E9%9D%92%E8%9B%99%E8%B7%B3%E5%8F%B0%E9%98%B6.py),一次跳一个或者两个;铺瓷砖问题。[**变态青蛙跳**](https://github.com/Einstellung/AlgorithmsByPython/blob/master/Target%20Offer/%E5%8F%98%E6%80%81%E9%9D%92%E8%9B%99%E8%B7%B3%E5%8F%B0%E9%98%B6.py),每次至少跳一个,至多跳n个,一共有f(n)=2<sup>n-1</sup>种跳法。考察数学建模的能力。以及[矩形覆盖问题](https://blog.csdn.net/Einstellung/article/details/90020345)

[面试题8:旋转数组的最小数字](https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/master/Target%20Offer/%E6%97%8B%E8%BD%AC%E6%95%B0%E7%BB%84%E7%9A%84%E6%9C%80%E5%B0%8F%E6%95%B0%E5%AD%97.py):二分查找的变形,注意到旋转数组的首元素肯定不小于旋转数组的尾元素,设置中间点。如果中间点大于首元素,说明最小数字在后面一半,如果中间点小于尾元素,说明最小数字在前一半。依次循环。同时,当一次循环中首元素小于尾元素,说明最小值就是首元素。但是当首元素等于尾元素等于中间值,只能在这个区域顺序查找。