heap

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMidNum

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

func NewGetMidNum

func NewGetMidNum() *GetMidNum

func (*GetMidNum) FindMedian

func (m *GetMidNum) FindMedian() float64

func (*GetMidNum) GetAttribute

func (m *GetMidNum) GetAttribute() *C.Attribute

func (*GetMidNum) Offer

func (m *GetMidNum) Offer(value int)

type MaxSlidingWindowByPQ

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

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/7/26 00:15
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 滑动窗口的最大值 *

func (*MaxSlidingWindowByPQ) GetAttribute

func (m *MaxSlidingWindowByPQ) GetAttribute() *C.Attribute

func (*MaxSlidingWindowByPQ) Method

func (m *MaxSlidingWindowByPQ) Method(array []int, k int) []int

type PriorityQueue

type PriorityQueue struct {
	IsSmallHeap bool

	Comp C.Compare // 比较器
	// contains filtered or unexported fields
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/6/27 01:12
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 优先队列 *

func NewPriorityQueue

func NewPriorityQueue(options ...C.Options) *PriorityQueue

func (*PriorityQueue) Empty

func (m *PriorityQueue) Empty() bool

func (*PriorityQueue) GetAttribute

func (m *PriorityQueue) GetAttribute() *C.Attribute

func (*PriorityQueue) Offer

func (m *PriorityQueue) Offer(value interface{})

func (*PriorityQueue) Peak

func (m *PriorityQueue) Peak() interface{}

func (*PriorityQueue) Poll

func (m *PriorityQueue) Poll() interface{}

func (*PriorityQueue) Resize

func (m *PriorityQueue) Resize()

func (*PriorityQueue) Size

func (m *PriorityQueue) Size() int

func (*PriorityQueue) Update

func (m *PriorityQueue) Update(value interface{})

type ReturnKMinByHeapSort

type ReturnKMinByHeapSort struct {
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/6/27 19:27
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 返回数组中最小的 k 个元素 -> 堆排法 *

func (*ReturnKMinByHeapSort) GetAttribute

func (m *ReturnKMinByHeapSort) GetAttribute() *C.Attribute

func (*ReturnKMinByHeapSort) ReturnKMin

func (m *ReturnKMinByHeapSort) ReturnKMin(array []int, k int) []int

type ReturnKMinByQuickSort

type ReturnKMinByQuickSort struct {
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/6/27 19:28
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 返回数组中最小的 k 个元素 -> 快排法 *

func (*ReturnKMinByQuickSort) GetAttribute

func (m *ReturnKMinByQuickSort) GetAttribute() *C.Attribute

func (*ReturnKMinByQuickSort) ReturnKMin

func (m *ReturnKMinByQuickSort) ReturnKMin(array []int, k int) []int

type WordFrequency

type WordFrequency struct {
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/6/27 01:12
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 词频统计
  • 实现统计一篇英文文章内每个单词的出现频率,并返回出现频率最高的前3个单词及其出现次数 *

func (*WordFrequency) GetAttribute

func (m *WordFrequency) GetAttribute() *C.Attribute

func (*WordFrequency) Statistics

func (m *WordFrequency) Statistics(words []string) []string

Jump to

Keyboard shortcuts

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