Skip to content

gompact/dbl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBL (Doubly Linked List)

dbl is a Doubly Linked List implementation in Go

Usage

package main

import "github.com/gompact/dbl"

func main() {
    // create empty list
    l := dbl.NewList()
    // append values to the list
    l.Append("first node")
    l.Append("second node")
    
    // remove first index
    ok := l.Remove(0)

    // Pop last element
    l.Append("third node")
    thirdNode := l.Pop()

    // Add element to the beginning of the list
    l.Prepend("zero node")

    // remove all elements in the list
    l.RemoveAll()
    
    // get length of the list
    length := l.Length()
}

Releases

No releases published

Packages

No packages published

Languages