|
|
@ -7,14 +7,14 @@ Write a function `ListPushBack` that inserts a new element `node` at the beginni |
|
|
|
### Expected function and structure |
|
|
|
### Expected function and structure |
|
|
|
|
|
|
|
|
|
|
|
```go |
|
|
|
```go |
|
|
|
type Node struct { |
|
|
|
type NodeL struct { |
|
|
|
Data interface{} |
|
|
|
Data interface{} |
|
|
|
Next *Node |
|
|
|
Next *NodeL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type List struct { |
|
|
|
type List struct { |
|
|
|
Head *Node |
|
|
|
Head *NodeL |
|
|
|
Tail *Node |
|
|
|
Tail *NodeL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func ListPushFront(l *List, data interface{}) { |
|
|
|
func ListPushFront(l *List, data interface{}) { |
|
|
|