forked from LeKSuS-04/mephictf-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlrucache.go
More file actions
35 lines (29 loc) · 810 Bytes
/
lrucache.go
File metadata and controls
35 lines (29 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package lrucache
type LruCache struct {
// Add your fields here
}
// Creates a new LruCache with the given capacity.
func New(capacity int) *LruCache {
return nil
}
// Get returns value associated with the key.
//
// The second value is a bool that is true if the key exists in the cache,
// and false if not.
func (l *LruCache) Get(key int) (int, bool) {
return 0, false
}
// Set updates value associated with the key.
//
// If there is no key in the cache new (key, value) pair is created.
func (l *LruCache) Set(key, value int) {
}
// Range calls function f on all elements of the cache
// in increasing access time order.
//
// Stops earlier if f returns false.
func (l *LruCache) Range(f func(key, value int) bool) {
}
// Clear removes all elements from the cache.
func (l *LruCache) Clear() {
}