problem

package
v0.0.0-...-77fe0ec Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoubleLinkNode

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

DoubleLinkNode 双向链表

type IntSlice

type IntSlice []int

IntSlice 整形切片

func (IntSlice) Len

func (s IntSlice) Len() int

func (IntSlice) Less

func (s IntSlice) Less(i, j int) bool

func (IntSlice) Swap

func (s IntSlice) Swap(i, j int)

type LRUCache

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

LRUCache LRU缓存

func Constructor

func Constructor(capacity int) LRUCache

Constructor 构造

func (*LRUCache) Get

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

Get 获取

func (*LRUCache) Put

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

Put 存储

func (*LRUCache) String

func (l *LRUCache) String() string

String 字符串

type LinkNode

type LinkNode struct {
	Val  int
	Next *LinkNode
}

LinkNode 链表结点

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

ListNode 链表

type MyHashMap

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

MyHashMap 自定义HashMap

func NewMyHashMap

func NewMyHashMap() MyHashMap

NewMyHashMap 构造器

func (*MyHashMap) Get

func (m *MyHashMap) Get(key int) int

Get 返回特定的 key 所映射的 value

func (*MyHashMap) Put

func (m *MyHashMap) Put(key int, value int)

Put 向 HashMap 插入一个键值对 (key, value)

func (*MyHashMap) Remove

func (m *MyHashMap) Remove(key int)

Remove 如果映射中存在 key 的映射,则移除 key 和它所对应的 value

type MyQueue

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

MyQueue 队列

func NewMyQueue

func NewMyQueue() MyQueue

NewMyQueue 构造器

func (*MyQueue) Empty

func (q *MyQueue) Empty() bool

Empty 队列是否为空

func (*MyQueue) Peek

func (q *MyQueue) Peek() int

Peek 返回队列开头的元素

func (*MyQueue) Pop

func (q *MyQueue) Pop() int

Pop 从队列的开头移除并返回元素

func (*MyQueue) Push

func (q *MyQueue) Push(x int)

Push 将元素 x 推到队列的末尾

type Node

type Node struct {
	Val   int
	Left  *Node
	Right *Node
	Next  *Node
}

Node 节点

type TreeNode

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

TreeNode 树节点

Source Files

Jump to

Keyboard shortcuts

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