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 returns RandomizedSet * Initialize your data structure here.
func (*RandomizedSet) GetRandom ¶
func (r *RandomizedSet) GetRandom() int
GetRandom 获取随机数据 * Get a random element from the set.
func (*RandomizedSet) Insert ¶
func (r *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 (r *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.