mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
Update 链表理论基础 about rust
This commit is contained in:
@ -218,6 +218,21 @@ class ListNode(_x: Int = 0, _next: ListNode = null) {
|
||||
}
|
||||
```
|
||||
|
||||
Rust:
|
||||
```rust
|
||||
pub struct Node<T> {
|
||||
value: T,
|
||||
next: Link<T>,
|
||||
}
|
||||
|
||||
type Link<T> = Option<Box<Node<T>>>;
|
||||
|
||||
// 附设头节点
|
||||
pub struct List<T> {
|
||||
head: Link<T>,
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
-----------------------
|
||||
<div align="center"><img src=https://code-thinking.cdn.bcebos.com/pics/01二维码一.jpg width=500> </img></div>
|
||||
|
Reference in New Issue
Block a user