mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
feat: add rust docs (#815)
* feat: add rust docs * Import std types for built_in_hash doc
This commit is contained in:
@@ -278,20 +278,16 @@
|
||||
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