Browse Source

rename previous and cleanup doubles

content-update
Clement Denis 5 years ago committed by Clément
parent
commit
1477f9303e
  1. 0
      subjects/abort.en.md
  2. 0
      subjects/activebits.en.md
  3. 0
      subjects/alphamirror.en.md
  4. 0
      subjects/bool.en.md
  5. 0
      subjects/btreeapplybylevel.en.md
  6. 0
      subjects/btreedeletenode.en.md
  7. 0
      subjects/btreeisbinary.en.md
  8. 0
      subjects/btreelevelcount.en.md
  9. 0
      subjects/btreemax.en.md
  10. 0
      subjects/btreemin.en.md
  11. 0
      subjects/btreetransplant.en.md
  12. 0
      subjects/cat.en.md
  13. 0
      subjects/collatzcountdown.en.md
  14. 0
      subjects/comcheck.en.md
  15. 0
      subjects/compact.en.md
  16. 0
      subjects/countdown.en.md
  17. 0
      subjects/createelem.en.md
  18. 0
      subjects/dispfirstpar.en.md
  19. 0
      subjects/displastpar.en.md
  20. 0
      subjects/displaya.en.md
  21. 0
      subjects/displayalpham.en.md
  22. 0
      subjects/displayalrevm.en.md
  23. 0
      subjects/displayfile.en.md
  24. 0
      subjects/displayz.en.md
  25. 0
      subjects/enigma.en.md
  26. 0
      subjects/firstword.en.md
  27. 0
      subjects/fixthemain.en.md
  28. 0
      subjects/hello.en.md
  29. 0
      subjects/inter.en.md
  30. 43
      subjects/join.md
  31. 0
      subjects/lastword.en.md
  32. 60
      subjects/listat.md
  33. 77
      subjects/listclear.md
  34. 64
      subjects/listfind.md
  35. 65
      subjects/listforeach.md
  36. 105
      subjects/listforeachif.md
  37. 58
      subjects/listlast.md
  38. 78
      subjects/listmerge.md
  39. 60
      subjects/listpushback.md
  40. 60
      subjects/listpushfront.md
  41. 0
      subjects/listpushpara.en.md
  42. 99
      subjects/listremoveif.md
  43. 65
      subjects/listreverse.md
  44. 56
      subjects/listsize.md
  45. 89
      subjects/listsort.md
  46. 0
      subjects/max.en.md
  47. 0
      subjects/onlya.en.md
  48. 0
      subjects/onlyz.en.md
  49. 0
      subjects/pilot.en.md
  50. 0
      subjects/point.en.md
  51. 0
      subjects/printbits.en.md
  52. 0
      subjects/rectangle.en.md
  53. 0
      subjects/repeatalpha.en.md
  54. 0
      subjects/reversebits.en.md
  55. 0
      subjects/rot13.en.md
  56. 0
      subjects/rot14.en.md
  57. 0
      subjects/searchreplace.en.md
  58. 71
      subjects/sortedlistmerge.md
  59. 87
      subjects/sortlistinsert.md
  60. 24
      subjects/strlen.md
  61. 0
      subjects/swapbits.en.md
  62. 0
      subjects/switchcase.en.md
  63. 0
      subjects/union.en.md
  64. 0
      subjects/unmatch.en.md
  65. 0
      subjects/wdmatch.en.md
  66. 0
      subjects/ztail.en.md

0
subjects/abort.md → subjects/abort.en.md

0
subjects/activebits.md → subjects/activebits.en.md

0
subjects/alphamirror.md → subjects/alphamirror.en.md

0
subjects/bool.md → subjects/bool.en.md

0
subjects/btreeapplybylevel.md → subjects/btreeapplybylevel.en.md

0
subjects/btreedeletenode.md → subjects/btreedeletenode.en.md

0
subjects/btreeisbinary.md → subjects/btreeisbinary.en.md

0
subjects/btreelevelcount.md → subjects/btreelevelcount.en.md

0
subjects/btreemax.md → subjects/btreemax.en.md

0
subjects/btreemin.md → subjects/btreemin.en.md

0
subjects/btreetransplant.md → subjects/btreetransplant.en.md

0
subjects/cat.md → subjects/cat.en.md

0
subjects/collatzcountdown.md → subjects/collatzcountdown.en.md

0
subjects/comcheck.md → subjects/comcheck.en.md

0
subjects/compact.md → subjects/compact.en.md

0
subjects/countdown.md → subjects/countdown.en.md

0
subjects/createelem.md → subjects/createelem.en.md

0
subjects/dispfirstpar.md → subjects/dispfirstpar.en.md

0
subjects/displastpar.md → subjects/displastpar.en.md

0
subjects/displaya.md → subjects/displaya.en.md

0
subjects/displayalpham.md → subjects/displayalpham.en.md

0
subjects/displayalrevm.md → subjects/displayalrevm.en.md

0
subjects/displayfile.md → subjects/displayfile.en.md

0
subjects/displayz.md → subjects/displayz.en.md

0
subjects/enigma.md → subjects/enigma.en.md

0
subjects/firstword.md → subjects/firstword.en.md

0
subjects/fixthemain.md → subjects/fixthemain.en.md

0
subjects/hello.md → subjects/hello.en.md

0
subjects/inter.md → subjects/inter.en.md

43
subjects/join.md

@ -1,43 +0,0 @@
## join
### Instructions
Write a function, Join, that returns the elements of a slice strings (arstr) join together in one string. Using the string 'sep' as a separator between each element of the array
The function must have the next signature.
### Expected function
```go
func Join(arstr []string, sep string) string {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
student ".."
)
func main() {
arrStr := []string{"hello", "how", "are", "you"}
joined := student.Join(arrStr, "--")
fmt.Println(joined)
}
```
And its output :
```console
student@ubuntu:~/student/join$ go build
student@ubuntu:~/student/join$ ./join
hello--how--are--you
student@ubuntu:~/student/join$
```

0
subjects/lastword.md → subjects/lastword.en.md

60
subjects/listat.md

@ -1,60 +0,0 @@
## listpushback
### Instructions
Write a function `ListAt` that haves one pointer to the list, `l`, and an `int` as parameters. This function should print a `Node` of the linked list, depending on the number, `nbr`.
- In case of error it should print `nil`
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
func ListAt(l *Node, nbr int) *Node{
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &Node{}
ListPushBack(link, "hello")
ListPushBack(link, "how are")
ListPushBack(link, "you")
ListPushBack(link, 1)
fmt.Println()
fmt.Println(ListAt(link, 3).Data)
fmt.Println(ListAt(link, 1).Data)
fmt.Println(ListAt(link, 7))
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
you
hello
<nil>
student@ubuntu:~/piscine/test$
```

77
subjects/listclear.md

@ -1,77 +0,0 @@
## listpushback
### Instructions
Write a function `ListClear` that delets all `nodes` from a linked list, deleting the link between the list.
- Tip: assign the list's pointer to nil
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListClear(l *List) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
type List = piscine.List
type Node = piscine.Node
func PrintList(l *List) {
link := l.Head
for link != nil {
fmt.Print(link.Data, " -> ")
link = link.Next
}
fmt.Println(nil)
}
func main() {
link := &List{}
piscine.ListPushBack(link, "I")
piscine.ListPushBack(link, 1)
piscine.ListPushBack(link, "something")
piscine.ListPushBack(link, 2)
fmt.Println("------list------")
PrintList(link)
piscine.ListClear(link)
fmt.Println("------updated list------")
PrintList(link)
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
------list------
I -> 1 -> something -> 2 -> <nil>
------updated list------
<nil>
student@ubuntu:~/piscine/test$
```

64
subjects/listfind.md

@ -1,64 +0,0 @@
## listpushback
### Instructions
Write a function `ListFind` that returns the value of the first link that the function in the arguments its equal.
- For this you shoud use the function `CompStr`.
- Use pointers when ever you can.
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func CompStr(l *list) bool {
}
func ListFind(l *List, comp func(l *List) bool) *interface{} {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &List{}
piscine.ListPushBack(link, 1)
piscine.ListPushBack(link, "hello")
piscine.ListPushBack(link, "hello2")
piscine.ListPushBack(link, "hello3")
fmt.Println(piscine.ListFind(link, CompStr))
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
hello
student@ubuntu:~/piscine/test$
```

65
subjects/listforeach.md

@ -1,65 +0,0 @@
## listpushback
### Instructions
Write a function `ListForEach` that applies a function given as argument to the information within each of the list's links.
- The function given as argument must have a pointer as argument: `l *list`
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListForEach(l *list, f func(l *list)) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &List{}
piscine.ListPushBack(link, 1)
piscine.ListPushBack(link, 2)
piscine.ListPushBack(link, 3)
piscine.ListPushBack(link, 4)
piscine.ListForEach(link, piscine.ListReverse)
for link.Head != nil {
fmt.Println(link.Head.Data)
link.Head = link.Head.Next
}
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
4
3
2
1
student@ubuntu:~/piscine/test$
```

105
subjects/listforeachif.md

@ -1,105 +0,0 @@
## listpushback
### Instructions
Write a function `ListForEachIf` that applies a function given as argument to the information within some links of the list.
- For this you will have to create a function `CompStr`, that returns a `bool`, to compare each elemente of the linked list, to see if it is a string, and than apply the function in the argument of `ListForEachIf`.
- The function given as argument as to have a pointer as argument: `l *list`.
- Use pointers wen ever you can.
### Expected function and structure
```go
type node struct {
data interface{}
next *node
}
type list struct {
head *node
tail *node
}
func CompStr(l *list) bool {
}
func ListForEachIf(l *list, f func(l *list), comp func(l *list) bool) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func PrintElem(l *list) {
fmt.Println(l.head.data)
}
func StringToInt(l *list) {
count := 1
l.head.data = count
}
func PrintList(l *list) {
m := l.head
for m != nil {
fmt.Print(m.data, " -> ")
m = m.next
}
fmt.Print(l.tail)
}
func main() {
link := &list{}
piscine.ListPushBack(link, 1)
piscine.ListPushBack(link, "hello")
piscine.ListPushBack(link, 3)
piscine.ListPushBack(link, "there")
piscine.ListPushBack(link, 23)
piscine.ListPushBack(link, "!")
piscine.ListPushBack(link, 54)
PrintAllList(link)
fmt.Println()
fmt.Println("--------function applied--------")
piscine.ListForEachIf(link, PrintElem, CompStr)
piscine.ListForEachIf(link, StringToInt, CompStr)
fmt.Println("--------function applied--------")
PrintAllList(link)
fmt.Println()
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
1 -> hello -> 3 -> there -> 23 -> ! -> 54 -> <nil>
--------function applied--------
hello
there
!
--------function applied--------
1 -> 1 -> 3 -> 1 -> 23 -> 1 -> 54 -> <nil>
student@ubuntu:~/piscine/test$
```

58
subjects/listlast.md

@ -1,58 +0,0 @@
## listpushback
### Instructions
Write a function `ListLast` that returns the last element of the linked list.
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListLast(l *list) *list {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &list{}
link2 := &list{}
piscine.ListPushBack(link, "three")
piscine.ListPushBack(link, 3)
piscine.ListPushBack(link, "1")
fmt.Println(piscine.ListLast(link).head)
fmt.Println(piscine.ListLast(link2).head)
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
&{1 <nil>}
<nil>
student@ubuntu:~/piscine/test$
```

78
subjects/listmerge.md

@ -1,78 +0,0 @@
## listpushback
### Instructions
Write a function `ListMerge` that places elements of a list `l2` at the end of an other list `l1`.
- You can't create new elements!
- Use pointers when ever you can.
### Expected function and structure
```go
type NodeL struct {
Data interface{}
Next *NodeL
}
type List struct {
Head *NodeL
Tail *NodeL
}
func listMerge(l1 *List, l2 *List) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
student ".."
)
func PrintList(l *List) {
m := l.Head
for m != nil {
fmt.Print(m.Data, " -> ")
m = m.Next
}
fmt.Print(nil)
fmt.Println()
}
func main() {
link := &List{}
link2 := &List{}
student.ListPushBack(link, "a")
student.ListPushBack(link, "b")
student.ListPushBack(link, "c")
student.ListPushBack(link, "d")
student.ListPushBack(link2, "e")
student.ListPushBack(link2, "f")
student.ListPushBack(link2, "g")
student.ListPushBack(link2, "h")
student.ListMerge(link, link2)
PrintList(link)
}
```
And its output :
```console
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
a -> b -> c -> d -> e -> f -> g -> h -> <nil>
student@ubuntu:~/student/test$
```

60
subjects/listpushback.md

@ -1,60 +0,0 @@
## listpushback
### Instructions
Write a function `ListPushBack` that inserts a new element `Node` at the end of the list, using the structure `List`
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListPushBack(l *List, data interface{}) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &List{}
piscine.ListPushBack(link, "Hello")
piscine.ListPushBack(link, "man")
piscine.ListPushBack(link, "how are you")
for link.Head != nil {
fmt.Println(link.Head.Data)
link.Head = link.Head.Next
}
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
Hello
man
how are you
student@ubuntu:~/piscine/test$
```

60
subjects/listpushfront.md

@ -1,60 +0,0 @@
## listpushback
### Instructions
Write a function `ListPushBack` that inserts a new element `node` at the beginning of the list using `list`
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListPushFront(l *list, data interface{}) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &list{}
piscine.ListPushFront(link, "Hello")
piscine.ListPushFront(link, "man")
piscine.ListPushFront(link, "how are you")
for link.head != nil {
fmt.Println(link.head.data)
link.head = link.head.next
}
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
how are you
man
Hello
student@ubuntu:~/piscine/test$
```

0
subjects/listpushpara.md → subjects/listpushpara.en.md

99
subjects/listremoveif.md

@ -1,99 +0,0 @@
## listpushback
### Instructions
Write a function `ListRemoveIf` that removes all elements that are equal to the `data_ref` introduced in the argument of the function.
- Use pointers wen ever you can.
### Expected function and structure
```go
type NodeL struct {
Data interface{}
Next *NodeL
}
type List struct {
Head *NodeL
Tail *NodeL
}
func ListPushFront(l *List, data interface{}) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func PrintList(l *List) {
m := l.Head
for m != nil {
fmt.Print(m.Data, " -> ")
m = m.Next
}
fmt.Print(nil)
fmt.Println()
}
func main() {
link := &List{}
link2 := &List{}
link3 := &List{}
fmt.Println("----normal state----")
student.ListPushBack(link2, 1)
PrintList(link2)
ListRemoveIf(link2, 1)
fmt.Println("------answer-----")
PrintList(link)
fmt.Println()
fmt.Println("----normal state----")
student.ListPushBack(link, 1)
student.ListPushBack(link, "Hello")
student.ListPushBack(link, 1)
student.ListPushBack(link, "There")
student.ListPushBack(link, 1)
student.ListPushBack(link, 1)
student.ListPushBack(link, "How")
student.ListPushBack(link, 1)
student.ListPushBack(link, "are")
student.ListPushBack(link, "you")
student.ListPushBack(link, 1)
PrintList(link)
ListRemoveIf(link, 1)
fmt.Println("------answer-----")
PrintList(link)
}
```
And its output :
```console
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
----normal state----
1 -> <nil>
------answer-----
<nil>
----normal state----
1 -> Hello -> 1 -> There -> 1 -> 1 -> How -> 1 -> are -> you -> 1 -> <nil>
------answer-----
Hello -> There -> How -> are -> you -> <nil>
student@ubuntu:~/piscine/test$
```

65
subjects/listreverse.md

@ -1,65 +0,0 @@
## listpushback
### Instructions
Write a function `ListReverse` that reverses the elements order of a given linked list.
- Use pointers when ever you can
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListReverse(l *list) {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &List{}
listPushBack(link, 1)
listPushBack(link, 2)
listPushBack(link, 3)
listPushBack(link, 4)
listReverse(link)
for link.Head != nil {
fmt.Println(link.Head.Data)
link.Head = link.Head.Next
}
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
4
3
2
1
student@ubuntu:~/piscine/test$
```

56
subjects/listsize.md

@ -1,56 +0,0 @@
## listpushback
### Instructions
Write a function `ListSize` that returns the number of elements in the list.
### Expected function and structure
```go
type Node struct {
Data interface{}
Next *Node
}
type List struct {
Head *Node
Tail *Node
}
func ListSize(l *List) int {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
link := &List{}
piscine.ListPushFront(link, "Hello")
piscine.ListPushFront(link, "2")
piscine.ListPushFront(link, "you")
piscine.ListPushFront(link, "man")
fmt.Println(piscine.ListSize(link))
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
4
student@ubuntu:~/piscine/test$
```

89
subjects/listsort.md

@ -1,89 +0,0 @@
## listpushback
### Instructions
Write a function `ListSort` that sorts the linked list by ascending order.
- This time you only will have the `Nodee` structure.
- Try to use recursive.
- Use pointers when ever you can.
### Expected function and structure
```go
type Nodee struct {
Data int
Next *Nodee
}
func ListSort(l *NodeL) *NodeL {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
student ".."
)
//Prints the list
func PrintList(l *Nodee) {
m := l
for m != nil {
fmt.Print(m.Data, " -> ")
m = m.next
}
fmt.Print(nil)
fmt.Println()
}
//insert elements
func listPushBack(l *Nodee, Data int) {
n := &Nodee{}
n.Data = Data
n.next = nil
if l == nil {
l = n
return
}
iterator := l
for iterator.next != nil {
iterator = iterator.next
}
iterator.next = n
}
func main() {
link := &Nodee{}
listPushBack(link, 5)
listPushBack(link, 4)
listPushBack(link, 3)
listPushBack(link, 2)
listPushBack(link, 1)
PrintList(student.ListSort(link))
}
```
And its output :
```console
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
0 -> 1 -> 2 -> 3 -> 4 -> 5 -> <nil>
student@ubuntu:~/student/test$
```

0
subjects/max.md → subjects/max.en.md

0
subjects/onlya.md → subjects/onlya.en.md

0
subjects/onlyz.md → subjects/onlyz.en.md

0
subjects/pilot.md → subjects/pilot.en.md

0
subjects/point.md → subjects/point.en.md

0
subjects/printbits.md → subjects/printbits.en.md

0
subjects/rectangle.md → subjects/rectangle.en.md

0
subjects/repeatalpha.md → subjects/repeatalpha.en.md

0
subjects/reversebits.md → subjects/reversebits.en.md

0
subjects/rot13.md → subjects/rot13.en.md

0
subjects/rot14.md → subjects/rot14.en.md

0
subjects/searchreplace.md → subjects/searchreplace.en.md

71
subjects/sortedlistmerge.md

@ -1,71 +0,0 @@
## listpushback
### Instructions
Write a function `SortedListMerge` that mereges two lists, `l1` and `l2`, but you have to join them in ascending order.
- Tip each list as to be already sorted, and initialized with 0.
- Use pointers when ever you can.
### Expected function and structure
```go
type Nodee struct {
Data interface{}
Next *Nodee
}
func SortedListMerge(l1 *Nodee, l2 *Nodee) *Nodee {
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
func PrintList(l *Nodee) {
m := l
for m != nil {
fmt.Print(m.Data, " -> ")
m = m.Next
}
fmt.Print(nil)
fmt.Println()
}
func main() {
link := &Nodee{}
link2 := &Nodee{}
piscine.ListPushBack(link, "5")
piscine.ListPushBack(link, "3")
piscine.ListPushBack(link, "7")
piscine.ListPushBack(link2, "1")
piscine.ListPushBack(link2, "-2")
piscine.ListPushBack(link2, "4")
piscine.ListPushBack(link2, "6")
PrintList(SortedListMerge(link, link2))
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
-2 -> 0 -> 0 -> 1 -> 3 -> 4 -> 5 -> 6 -> 7 -> <nil>
student@ubuntu:~/piscine/test$
```

87
subjects/sortlistinsert.md

@ -1,87 +0,0 @@
## listpushback
### Instructions
Write a function `SortListInsert` that inserts `Data_ref` in the linked list, but it as to remain sorted in ascending order.
- The list as to be alredy sorted.
- Use pointers when ever you can.
### Expected function and structure
```go
type Nodee struct {
Data int
Next *Nodee
}
func SortListInsert(l *Nodee, Data_ref int) *Nodee{
}
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
import (
"fmt"
piscine ".."
)
//Prints the list
func PrintList(l *Nodee) {
m := l
for m != nil {
fmt.Print(m.Data, " -> ")
m = m.Next
}
fmt.Print(nil)
fmt.Println()
}
//insert elements
func listPushBack(l *Nodee, Data int) {
n := &Nodee{}
n.Data = Data
n.Next = nil
if l == nil {
l = n
return
}
iterator := l
for iterator.Next != nil {
iterator = iterator.Next
}
iterator.Next = n
}
func main() {
link := &Nodee{}
listPushBack(link, 1)
listPushBack(link, 4)
listPushBack(link, 9)
PrintList(link)
link = sortListInsert(link, -2)
link = sortListInsert(link, 2)
PrintList(link)
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
-2 -> 0 -> 1 -> 2 -> 4 -> 9 -> <nil>
lee@lee:~/Documents/work/day11/11-16-sortlistinsert/so
student@ubuntu:~/piscine/test$
```

24
subjects/strlen.md

@ -1,24 +0,0 @@
## strlen
### Instructions
Write a function that returns the length of a string.
- `len` is forbidden
### Expected function and structure
```go
func Strlen(str string) int {
}
```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
4
student@ubuntu:~/piscine/test$
```

0
subjects/swapbits.md → subjects/swapbits.en.md

0
subjects/switchcase.md → subjects/switchcase.en.md

0
subjects/union.md → subjects/union.en.md

0
subjects/unmatch.md → subjects/unmatch.en.md

0
subjects/wdmatch.md → subjects/wdmatch.en.md

0
subjects/ztail.md → subjects/ztail.en.md

Loading…
Cancel
Save