Browse Source

Merge pull request #236 from 01-edu/fix-linkedlist

removing inconsistencies
content-update
augusto-mantilla 5 years ago committed by GitHub
parent
commit
7562e35c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      subjects/sortedlistmerge.en.md
  2. 13
      subjects/sortlistinsert.en.md

13
subjects/sortedlistmerge.en.md

@ -6,8 +6,6 @@ Write a function `SortedListMerge` that mereges two lists, `n1` and `n2`, but it
- Tip each list as to be already sorted. - Tip each list as to be already sorted.
- Use pointers when ever you can.
### Expected function and structure ### Expected function and structure
```go ```go
@ -33,13 +31,12 @@ type node = piscine.NodeI
type nodes = piscine.NodeI type nodes = piscine.NodeI
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 {

13
subjects/sortlistinsert.en.md

@ -6,8 +6,6 @@ Write a function `SortListInsert` that inserts `data_ref` in the linked list, bu
- The list as to be alredy sorted. - The list as to be alredy sorted.
- Use pointers when ever you can.
### Expected function and structure ### Expected function and structure
```go ```go
@ -30,13 +28,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