mohitranka / collections

Yet another go collections package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

collections

A collections of various datastructures in go

Usage


package main

import ( 
    "fmt"
    "github.com/mohitranka/collections/skiplist"
)

func main() {
    sl := skiplist.NewSkipList(3, 0.5)
    sl.Insert(10)
    sl.Insert(20)
    sl.Insert(5)

    sl.Search(5)    // returns true
    sl.Search(17)   // returns false

    sl.Delete(20)   // returns true
    sl.Search(20)   // returns false

    fmt.Print(sl.Display()) // Print the string representation on stdout
}

Authors

  • Mohit Ranka

License

This project is licensed under the MIT License - See LICENSE for details.

About

Yet another go collections package

License:MIT License


Languages

Language:Go 100.0%