Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstUniqueNumber ¶
*
- @param nums: a continuous stream of numbers
- @param number: a number
- @return: returns the first unique number
func NthUglyNumber2 ¶
Types ¶
type DataStream ¶
type DataStream struct {
// contains filtered or unexported fields
}
func NewDataStream ¶
func NewDataStream() *DataStream
func (*DataStream) Add ¶
func (ds *DataStream) Add(num int)
func (*DataStream) FirstUnique ¶
func (ds *DataStream) FirstUnique() int
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
func NewLRUCache ¶
type RandomizedSet ¶
type RandomizedSet struct {
// contains filtered or unexported fields
}
func NewRandomizedSet ¶
func NewRandomizedSet() *RandomizedSet
func (*RandomizedSet) GetRandom ¶
func (this *RandomizedSet) GetRandom() int
GetRandom get a random element from the set
func (*RandomizedSet) Insert ¶
func (this *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 (this *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.