mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 19:44:45 +08:00
Merge pull request #1040 from leeeeeeewii/linkedlist
添加链表理论基础 python go版本
This commit is contained in:
@ -195,10 +195,20 @@ class ListNode {
|
|||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
Python:
|
||||||
|
```python
|
||||||
|
class ListNode:
|
||||||
|
def __init__(self, val, next=None):
|
||||||
|
self.val = val
|
||||||
|
self.next = next
|
||||||
|
```
|
||||||
|
|
||||||
Go:
|
Go:
|
||||||
|
```go
|
||||||
|
type ListNode struct {
|
||||||
|
Val int
|
||||||
|
Next *ListNode
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user