|
|
@ -2,19 +2,19 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Write a function `ListPushBack` that inserts a new element `Node` at the end of the list, using the structure `List` |
|
|
|
Write a function `ListPushBack` that inserts a new element `NodeL` at the end of the list, using the structure `List` |
|
|
|
|
|
|
|
|
|
|
|
### 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 ListPushBack(l *List, data interface{}) { |
|
|
|
func ListPushBack(l *List, data interface{}) { |
|
|
|