Skip to content

Instantly share code, notes, and snippets.

@voelzmo
Created June 27, 2019 18:47
Show Gist options
  • Save voelzmo/57b9f35ce43ebf06f4ef68b25b89291f to your computer and use it in GitHub Desktop.
Save voelzmo/57b9f35ce43ebf06f4ef68b25b89291f to your computer and use it in GitHub Desktop.
package linkedlist
import "errors"
type Element struct {
Val interface{}
}
type List struct{}
var ErrEmptyList = errors.New("empty list")
func (e *Element) Next() *Element {
return &Element{}
}
func (e *Element) Prev() *Element {
return nil
}
func NewList(args ...interface{}) *List {
return &List{}
}
func (l *List) PushFront(v interface{}) {
}
func (l *List) PushBack(v interface{}) {
}
func (l *List) PopFront() (interface{}, error) {
return nil, nil
}
func (l *List) PopBack() (interface{}, error) { return nil, nil }
func (l *List) Reverse() *List { return nil }
func (l *List) First() *Element { return &Element{1} }
func (l *List) Last() *Element { return nil }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment