mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-06 20:20:05 +08:00
build
This commit is contained in:
@@ -288,20 +288,16 @@ comments: true
|
||||
stack.push(4);
|
||||
|
||||
/* 访问栈顶元素 */
|
||||
if let Some(top) = stack.get(stack.len() - 1) {
|
||||
}
|
||||
if let Some(top) = stack.last() {
|
||||
}
|
||||
let top = stack[stack.len() - 1];
|
||||
|
||||
/* 元素出栈 */
|
||||
if let Some(pop) = stack.pop() {
|
||||
}
|
||||
let pop = stack.pop().unwrap();
|
||||
|
||||
/* 获取栈的长度 */
|
||||
let size = stack.len();
|
||||
|
||||
/* 判断是否为空 */
|
||||
let isEmpty = stack.is_empty();
|
||||
let is_empty = stack.is_empty();
|
||||
```
|
||||
|
||||
=== "C"
|
||||
|
||||
Reference in New Issue
Block a user