diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-02 20:22:13 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-02 20:22:13 +0300 |
| commit | 0c6d4ed2e499e3e17165e43803d0d1c6dd0956d9 (patch) | |
| tree | 6d6a5df53d1dd3e655d24f0423f24bc52ad9784c /search/set.go | |
| parent | f78ba2cdc6840dbc52a27a2f9fac28f3b61e8b7b (diff) | |
initial generics
Diffstat (limited to 'search/set.go')
| -rw-r--r-- | search/set.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/search/set.go b/search/set.go index ed5b442..58ac2fb 100644 --- a/search/set.go +++ b/search/set.go @@ -1,16 +1,19 @@ package search -import "fmt" +import ( + "fmt" + "codeberg.org/snonux/algorithms/ds" +) var ( NotFound = fmt.Errorf("could not find entry") NotImplemented = fmt.Errorf("method not implemented") ) -type Set interface { +type Set[K ds.Integer,V ds.Number] interface { Empty() bool Size() int - Put(key int, val int) - Get(key int) (int, error) - Del(key int) (int, error) + Put(key K, val V) + Get(key K) (V, error) + Del(key K) (V, error) } |
