mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-12 05:20:59 +08:00
adddddd
This commit is contained in:
@ -76,7 +76,7 @@ public:
|
|||||||
```
|
```
|
||||||
|
|
||||||
时间复杂度:O(n)
|
时间复杂度:O(n)
|
||||||
时间复杂度:O(1)
|
空间复杂度:O(1)
|
||||||
|
|
||||||
效率如下:
|
效率如下:
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ public:
|
|||||||
|
|
||||||
**大家要仔细看注释,思考为什么要写while (left < right), 为什么要写right = middle**。
|
**大家要仔细看注释,思考为什么要写while (left < right), 为什么要写right = middle**。
|
||||||
|
|
||||||
```
|
```cpp
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
int searchInsert(vector<int>& nums, int target) {
|
int searchInsert(vector<int>& nums, int target) {
|
||||||
|
@ -88,7 +88,8 @@
|
|||||||
|
|
||||||
|
|
||||||
以上分析完毕,C++代码如下:
|
以上分析完毕,C++代码如下:
|
||||||
```
|
|
||||||
|
```cpp
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
int climbStairs(int n) {
|
int climbStairs(int n) {
|
||||||
|
Reference in New Issue
Block a user