solution

package
v0.0.0-...-9b92ec5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RandomizedSet

type RandomizedSet struct {
}

func Constructor

func Constructor() RandomizedSet

* Initialize your data structure here.

func (*RandomizedSet) GetRandom

func (this *RandomizedSet) GetRandom() int

* Get a random element from the set.

func (*RandomizedSet) Insert

func (this *RandomizedSet) Insert(val int) bool

* 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

* Removes a value from the set. Returns true if the set contained the specified element.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL