ldesign

package
v0.0.0-...-d229d73 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSTIterator

type BSTIterator struct {
	// contains filtered or unexported fields
}

func BSTIteratorConstructor

func BSTIteratorConstructor(root *TreeNode) BSTIterator

func (*BSTIterator) HasNext

func (this *BSTIterator) HasNext() bool

* @return whether we have a next smallest number

func (*BSTIterator) Next

func (this *BSTIterator) Next() int

* @return the next smallest number

type LRUCache

type LRUCache struct {
	Head *node
	Tail *node
	HT   map[int]*node
	Cap  int
}

func LRUCacheConstructor

func LRUCacheConstructor(capacity int) LRUCache

func (*LRUCache) Get

func (this *LRUCache) Get(key int) int

func (*LRUCache) Put

func (this *LRUCache) Put(key int, value int)

type RandomizedSet

type RandomizedSet struct {
	// contains filtered or unexported fields
}

func RandomizedSetConstructor

func RandomizedSetConstructor() 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.

type StringIterator

type StringIterator struct {
	String string
	// contains filtered or unexported fields
}

func Constructor

func Constructor(compressedString string) StringIterator

func (*StringIterator) HasNext

func (this *StringIterator) HasNext() bool

func (*StringIterator) Next

func (this *StringIterator) Next() byte

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

type WordDictionary

type WordDictionary struct {
	// contains filtered or unexported fields
}

WordDictionary based on trie.

func WDConstructor

func WDConstructor() WordDictionary

* Initialize your data structure here.

func (*WordDictionary) AddWord

func (this *WordDictionary) AddWord(word string)

* Adds a word into the data structure.

func (*WordDictionary) Search

func (this *WordDictionary) Search(word string) bool

* Returns if the word is in the data structure. A word could contain the dot character '.' to represent any one letter.

Jump to

Keyboard shortcuts

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