Browse Source

Merge pull request #240 from 01-edu/fixlistsort

fix PrintList
content-update
augusto-mantilla 5 years ago committed by GitHub
parent
commit
076558e090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      subjects/listsort.en.md

15
subjects/listsort.en.md

@ -6,10 +6,6 @@ Write a function `ListSort` that sorts the linked list by ascending order.
- This time you only will have the `node` structure. - This time you only will have the `node` structure.
- Try to use recursive.
- Use pointers when ever you can.
### Expected function and structure ### Expected function and structure
```go ```go
@ -37,13 +33,12 @@ import (
) )
func PrintList(l *piscine.NodeI) { func PrintList(l *piscine.NodeI) {
m := l it := l
for m != nil { for it != nil {
fmt.Print(m.Data, " -> ") fmt.Print(it.Data, " -> ")
m = m.Next it = it.Next
} }
fmt.Print(nil) fmt.Print(nil, "\n")
fmt.Println()
} }
func listPushBack(l *piscine.NodeI, data int) *piscine.NodeI { func listPushBack(l *piscine.NodeI, data int) *piscine.NodeI {

Loading…
Cancel
Save