Whoo! Data Structures (Only Include Basic Operations)
Make sure you have you set your GOPATH (https://github.com/golang/go/wiki/GOPATH). Type the command below to install the package.
$ go get github.com/carljoshua/structsImport the package and then create the data structure you need. Simple as that. The data structures that are included in this package are:
- Stack
- Queue
- Linked List
- Heap
package main
import (
"github.com/carljoshua/structs"
"reflect"
)
func main(){
s := structs.NewStack(reflect.Int, 4)
s.Push(1)
s.Push(2)
s.Pop()
}