Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomizedCollection ¶
type RandomizedCollection struct {
// contains filtered or unexported fields
}
RandomizedCollection 是一个随机获取的集合
func Constructor ¶
func Constructor() RandomizedCollection
Constructor returns RandomizedSet Initialize your data structure here.
func (*RandomizedCollection) GetRandom ¶
func (r *RandomizedCollection) GetRandom() int
GetRandom 获取随机数据 Get a random element from the collection.
func (*RandomizedCollection) Insert ¶
func (r *RandomizedCollection) Insert(val int) bool
Insert 插入数据 Inserts a value to the collection. Returns true if the collection did not already contain the specified element.
func (*RandomizedCollection) Remove ¶
func (r *RandomizedCollection) Remove(val int) bool
Remove 删除数据 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.