Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomizedSet ¶
type RandomizedSet struct {
// contains filtered or unexported fields
}
RandomizedSet ...
func Constructor ¶
func Constructor() RandomizedSet
Constructor initialize your data structure here.
func (*RandomizedSet) GetRandom ¶
func (set *RandomizedSet) GetRandom() int
GetRandom get a random element from the set.
func (*RandomizedSet) Insert ¶
func (set *RandomizedSet) Insert(val int) bool
Insert inserts a value to the set. Returns true if the set did not already contain the specified element.
func (*RandomizedSet) Remove ¶
func (set *RandomizedSet) Remove(val int) bool
Remove removes a value from the set. Returns true if the set contained the specified element.
Click to show internal directories.
Click to hide internal directories.