tutorials

package
v0.0.0-...-f750034 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDoublyList

func InitDoublyList() *doublyLinkedList

func PrintArr

func PrintArr(arr []int)

func RandomSelect

func RandomSelect(nums []int, topK int) int

找出数组中的topK,

算法: 随机选择: O(n) 时间复杂度

Types

type LFStack

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

LFStack 无锁栈 使用链表实现

func NewLFStack

func NewLFStack() *LFStack

NewLFStack NewLFStack

func (*LFStack) Pop

func (s *LFStack) Pop() int32

Pop 出栈,没有数据时返回 nil

func (*LFStack) Push

func (s *LFStack) Push(v int32)

Push 入栈

type Node

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

Node 节点

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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