auto commit
This commit is contained in:
parent
791317ed53
commit
a704fb6e12
|
@ -1,5 +1,7 @@
|
||||||
# 10.1 斐波那契数列
|
# 10.1 斐波那契数列
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -8,7 +10,7 @@
|
||||||
|
|
||||||
<!--<div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}0&&{n=0}\\1&&{n=1}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
<!--<div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}0&&{n=0}\\1&&{n=1}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/45be9587-6069-4ab7-b9ac-840db1a53744.jpg" width="300px"> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/45be9587-6069-4ab7-b9ac-840db1a53744.jpg" width="330px"> </div><br>
|
||||||
|
|
||||||
## 解题思路
|
## 解题思路
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.2 矩形覆盖
|
# 10.2 矩形覆盖
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=11163&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=11163&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -22,7 +24,7 @@
|
||||||
|
|
||||||
<!-- <div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}1&&{n=1}\\2&&{n=2}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
<!-- <div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}1&&{n=1}\\2&&{n=2}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/508c6e52-9f93-44ed-b6b9-e69050e14807.jpg" width="350px"> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/508c6e52-9f93-44ed-b6b9-e69050e14807.jpg" width="370px"> </div><br>
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public int RectCover(int n) {
|
public int RectCover(int n) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.3 跳台阶
|
# 10.3 跳台阶
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4?tpId=13&tqId=11161&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4?tpId=13&tqId=11161&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.4 变态跳台阶
|
# 10.4 变态跳台阶
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 60. n 个骰子的点数
|
# 60. n 个骰子的点数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[Lintcode](https://www.lintcode.com/en/problem/dices-sum/)
|
[Lintcode](https://www.lintcode.com/en/problem/dices-sum/)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -12,7 +14,7 @@
|
||||||
|
|
||||||
### 动态规划
|
### 动态规划
|
||||||
|
|
||||||
使用一个二维数组 dp 存储点数出现的次数,其中 dp[i][j] 表示前 i 个骰子产生点数 j 的次数。
|
使用一个二维数组 dp 存储点数出现的次数,其中 dp\[i]\[j] 表示前 i 个骰子产生点数 j 的次数。
|
||||||
|
|
||||||
空间复杂度:O(N<sup>2</sup>)
|
空间复杂度:O(N<sup>2</sup>)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 61. 扑克牌顺子
|
# 61. 扑克牌顺子
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4?tpId=13&tqId=11198&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4?tpId=13&tqId=11198&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 62. 圆圈中最后剩下的数
|
# 62. 圆圈中最后剩下的数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6?tpId=13&tqId=11199&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6?tpId=13&tqId=11199&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# 63. 股票的最大利润
|
# 63. 股票的最大利润
|
||||||
|
|
||||||
[Leetcode](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/)
|
## 题目链接
|
||||||
|
|
||||||
|
[Leetcode:121. Best Time to Buy and Sell Stock ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 64. 求 1+2+3+...+n
|
# 64. 求 1+2+3+...+n
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&tqId=11200&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&tqId=11200&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 65. 不用加减乘除做加法
|
# 65. 不用加减乘除做加法
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/59ac416b4b944300b617d4f7f111b215?tpId=13&tqId=11201&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/59ac416b4b944300b617d4f7f111b215?tpId=13&tqId=11201&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 66. 构建乘积数组
|
# 66. 构建乘积数组
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46?tpId=13&tqId=11204&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46?tpId=13&tqId=11204&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 67. 把字符串转换成整数
|
# 67. 把字符串转换成整数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/1277c681251b4372bdef344468e4f26e?tpId=13&tqId=11202&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/1277c681251b4372bdef344468e4f26e?tpId=13&tqId=11202&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
in 栈用来处理入栈(push)操作,out 栈用来处理出栈(pop)操作。一个元素进入 in 栈之后,出栈的顺序被反转。当元素要出栈时,需要先进入 out 栈,此时元素出栈顺序再一次被反转,因此出栈顺序就和最开始入栈顺序是相同的,先进入的元素先退出,这就是队列的顺序。
|
in 栈用来处理入栈(push)操作,out 栈用来处理出栈(pop)操作。一个元素进入 in 栈之后,出栈的顺序被反转。当元素要出栈时,需要先进入 out 栈,此时元素出栈顺序再一次被反转,因此出栈顺序就和最开始入栈顺序是相同的,先进入的元素先退出,这就是队列的顺序。
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/3ea280b5-be7d-471b-ac76-ff020384357c.gif" width="400"/> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/3ea280b5-be7d-471b-ac76-ff020384357c.gif" width="450"/> </div><br>
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Stack<Integer> in = new Stack<Integer>();
|
Stack<Integer> in = new Stack<Integer>();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.1 斐波那契数列
|
# 10.1 斐波那契数列
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -8,7 +10,7 @@
|
||||||
|
|
||||||
<!--<div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}0&&{n=0}\\1&&{n=1}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
<!--<div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}0&&{n=0}\\1&&{n=1}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/45be9587-6069-4ab7-b9ac-840db1a53744.jpg" width="300px"> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/45be9587-6069-4ab7-b9ac-840db1a53744.jpg" width="330px"> </div><br>
|
||||||
|
|
||||||
## 解题思路
|
## 解题思路
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.2 矩形覆盖
|
# 10.2 矩形覆盖
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=11163&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=11163&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -22,7 +24,7 @@
|
||||||
|
|
||||||
<!-- <div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}1&&{n=1}\\2&&{n=2}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
<!-- <div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=\left\{\begin{array}{rcl}1&&{n=1}\\2&&{n=2}\\f(n-1)+f(n-2)&&{n>1}\end{array}\right." class="mathjax-pic"/></div> <br> -->
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/508c6e52-9f93-44ed-b6b9-e69050e14807.jpg" width="350px"> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/508c6e52-9f93-44ed-b6b9-e69050e14807.jpg" width="370px"> </div><br>
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public int RectCover(int n) {
|
public int RectCover(int n) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.3 跳台阶
|
# 10.3 跳台阶
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4?tpId=13&tqId=11161&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4?tpId=13&tqId=11161&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 10.4 变态跳台阶
|
# 10.4 变态跳台阶
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 60. n 个骰子的点数
|
# 60. n 个骰子的点数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[Lintcode](https://www.lintcode.com/en/problem/dices-sum/)
|
[Lintcode](https://www.lintcode.com/en/problem/dices-sum/)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
@ -12,7 +14,7 @@
|
||||||
|
|
||||||
### 动态规划
|
### 动态规划
|
||||||
|
|
||||||
使用一个二维数组 dp 存储点数出现的次数,其中 dp[i][j] 表示前 i 个骰子产生点数 j 的次数。
|
使用一个二维数组 dp 存储点数出现的次数,其中 dp\[i]\[j] 表示前 i 个骰子产生点数 j 的次数。
|
||||||
|
|
||||||
空间复杂度:O(N<sup>2</sup>)
|
空间复杂度:O(N<sup>2</sup>)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 61. 扑克牌顺子
|
# 61. 扑克牌顺子
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4?tpId=13&tqId=11198&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/762836f4d43d43ca9deb273b3de8e1f4?tpId=13&tqId=11198&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 62. 圆圈中最后剩下的数
|
# 62. 圆圈中最后剩下的数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6?tpId=13&tqId=11199&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6?tpId=13&tqId=11199&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# 63. 股票的最大利润
|
# 63. 股票的最大利润
|
||||||
|
|
||||||
[Leetcode](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/)
|
## 题目链接
|
||||||
|
|
||||||
|
[Leetcode:121. Best Time to Buy and Sell Stock ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 64. 求 1+2+3+...+n
|
# 64. 求 1+2+3+...+n
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&tqId=11200&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&tqId=11200&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 65. 不用加减乘除做加法
|
# 65. 不用加减乘除做加法
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/59ac416b4b944300b617d4f7f111b215?tpId=13&tqId=11201&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/59ac416b4b944300b617d4f7f111b215?tpId=13&tqId=11201&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 66. 构建乘积数组
|
# 66. 构建乘积数组
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46?tpId=13&tqId=11204&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46?tpId=13&tqId=11204&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 67. 把字符串转换成整数
|
# 67. 把字符串转换成整数
|
||||||
|
|
||||||
|
## 题目链接
|
||||||
|
|
||||||
[NowCoder](https://www.nowcoder.com/practice/1277c681251b4372bdef344468e4f26e?tpId=13&tqId=11202&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
[NowCoder](https://www.nowcoder.com/practice/1277c681251b4372bdef344468e4f26e?tpId=13&tqId=11202&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
|
||||||
|
|
||||||
## 题目描述
|
## 题目描述
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
in 栈用来处理入栈(push)操作,out 栈用来处理出栈(pop)操作。一个元素进入 in 栈之后,出栈的顺序被反转。当元素要出栈时,需要先进入 out 栈,此时元素出栈顺序再一次被反转,因此出栈顺序就和最开始入栈顺序是相同的,先进入的元素先退出,这就是队列的顺序。
|
in 栈用来处理入栈(push)操作,out 栈用来处理出栈(pop)操作。一个元素进入 in 栈之后,出栈的顺序被反转。当元素要出栈时,需要先进入 out 栈,此时元素出栈顺序再一次被反转,因此出栈顺序就和最开始入栈顺序是相同的,先进入的元素先退出,这就是队列的顺序。
|
||||||
|
|
||||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/3ea280b5-be7d-471b-ac76-ff020384357c.gif" width="400"/> </div><br>
|
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/3ea280b5-be7d-471b-ac76-ff020384357c.gif" width="450"/> </div><br>
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Stack<Integer> in = new Stack<Integer>();
|
Stack<Integer> in = new Stack<Integer>();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user