Skip to content

About

Sliding window implementation in Go

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

SlidingWindow

A simple implementation of a sliding window structure. It's basically a circular buffer that holds the last n elements that you add to it.

Example usage

sw, err := slidingwindow.New(3)
if err != nil {
    log.Fatal(err)
}

sw.Add(1)
sw.Add(2)
sw.Add(3)
sw.Add(4)
sw.Add(5)

fmt.Println(sw)
$ go run main.go
[3 4 5]

About

Sliding window implementation in Go

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages