Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RandomizedCollection ¶
type RandomizedCollection struct {
// contains filtered or unexported fields
}
func (*RandomizedCollection) GetRandom ¶
func (this *RandomizedCollection) GetRandom() int
* Get a random element from the collection.
func (*RandomizedCollection) Insert ¶
func (this *RandomizedCollection) Insert(val int) bool
* Inserts a value to the collection. Returns true if the collection did not already contain the specified element.
func (*RandomizedCollection) Remove ¶
func (this *RandomizedCollection) Remove(val int) bool
* Removes a value from the collection. Returns true if the collection contained the specified element.
Click to show internal directories.
Click to hide internal directories.