-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathsets.go
28 lines (24 loc) · 958 Bytes
/
sets.go
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
// Copyright (c) 2015, Emir Pasic. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package sets provides an abstract Set interface.
//
// In computer science, a set is an abstract data type that can store certain values and no repeated values. It is a computer implementation of the mathematical concept of a finite set. Unlike most other collection types, rather than retrieving a specific element from a set, one typically tests a value for membership in a set.
//
// Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29
package sets
import (
"github.com/emirpasic/gods/v2/containers"
)
// Set interface that all sets implement
type Set[T comparable] interface {
Add(elements ...T)
Remove(elements ...T)
Contains(elements ...T) bool
containers.Container[T]
// Empty() bool
// Size() int
// Clear()
// Values() []interface{}
// String() string
}