leetcode

package
v0.0.0-...-fdcae39 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0 Imports: 1 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 {
	// contains filtered or unexported fields
}

RandomizedSet ...

func Constructor

func Constructor() RandomizedSet

Constructor initialize your data structure here.

func (*RandomizedSet) GetRandom

func (set *RandomizedSet) GetRandom() int

GetRandom get a random element from the set.

func (*RandomizedSet) Insert

func (set *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 (set *RandomizedSet) Remove(val int) bool

Remove 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