Browse Source

Merge pull request #198 from 01-edu/chg-listpushback

fix listpushback readme
content-update
LEEDASILVA 5 years ago committed by GitHub
parent
commit
57ba3b6852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      subjects/listpushback.en.md

12
subjects/listpushback.en.md

@ -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{}) {
@ -35,7 +35,7 @@ import (
func main() { func main() {
link := &List{} link := &piscine.List{}
piscine.ListPushBack(link, "Hello") piscine.ListPushBack(link, "Hello")
piscine.ListPushBack(link, "man") piscine.ListPushBack(link, "man")

Loading…
Cancel
Save