-
Download and install it:
$ go get github.com/kerem37mert/linkedlist
-
Import it in your code:
import "github.com/kerem37mert/linkedlist"
package main
import (
"github.com/kerem37mert/linkedlist"
)
func main() {
myList := linkedlist.New()
}
package main
import (
"github.com/kerem37mert/linkedlist"
)
func main() {
myList := linkedlist.New()
myList.Add("go")
myList.Add("rust")
myList.Add("c++")
myList.Traversal()
}
package main
import (
"github.com/kerem37mert/linkedlist"
)
func main() {
myList := linkedlist.New()
myList.Add("go")
myList.Add("rust")
myList.Add("c++")
myList.Remove("go")
}
package main
import (
"github.com/kerem37mert/linkedlist"
)
func main() {
myList := linkedlist.New()
myList.Add("go")
myList.Add("rust")
myList.Add("c++")
myList.RemoveIndex(0)
}
package main
import (
"github.com/kerem37mert/linkedlist"
"fmt"
)
func main() {
myList := linkedlist.New()
myList.Add("go")
myList.Add("rust")
myList.Add("c++")
err := myList.Update(1, "C")
if err != nil {
fmt.Println(err)
}
}
package main
import (
"github.com/kerem37mert/linkedlist"
"fmt"
)
func main() {
myList := linkedlist.New()
myList.Add("go")
myList.Add("rust")
myList.Add("c++")
myList.ForEach(func(index uint, value any) {
fmt.Println(value)
})
}