unpack_string/hw04_lru_cache/list.go

27 lines
420 B
Go

package hw04lrucache
type List interface {
Len() int
Front() *ListItem
Back() *ListItem
PushFront(v interface{}) *ListItem
PushBack(v interface{}) *ListItem
Remove(i *ListItem)
MoveToFront(i *ListItem)
}
type ListItem struct {
Value interface{}
Next *ListItem
Prev *ListItem
}
type list struct {
List // Remove me after realization.
// Place your code here.
}
func NewList() List {
return new(list)
}