Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Skip List Implementation Using "Go".

branch: master

A golang Skip List Implementation.

This is a typical skip list implementation using go. It is a kind of ordered map and can store any value inside.

See Skip List wikipedia page to learn more about this data structure.

How To Use

Here is a quick tutorial to show how easy to use it.

import ""

func main() {
    // create a list with int key
    // most built-in sortable type is supported
    // see "go doc" for more details
    list := skiplist.New(skiplist.Int)

    // add some values
    list.Set(12, "hello world")
    list.Set(34, 56)

    // get element
    elem := list.Get(34) // value is stored in elem.Value
    next := elem.Next()  // get next element

    // or get value directly just like using a map
    val, ok := list.GetValue(34)

    // remove an element

Use go doc to see usage and more docs.

go doc
Something went wrong with that request. Please try again.