mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
Update 0225.用队列实现栈.md
This commit is contained in:
@ -111,7 +111,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
* 时间复杂度: push为O(n),其他为O(1)
|
* 时间复杂度: pop为O(n),其他为O(1)
|
||||||
* 空间复杂度: O(n)
|
* 空间复杂度: O(n)
|
||||||
|
|
||||||
## 优化
|
## 优化
|
||||||
@ -158,7 +158,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
* 时间复杂度: push为O(n),其他为O(1)
|
* 时间复杂度: pop为O(n),其他为O(1)
|
||||||
* 空间复杂度: O(n)
|
* 空间复杂度: O(n)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user