Documentation ¶ Index ¶ type MaxHeap func GetMaxHeapFromArr(arr []interface{}) *MaxHeap func New() *MaxHeap func (h *MaxHeap) Add(e interface{}) func (h *MaxHeap) ExtractMax() interface{} func (h *MaxHeap) FindMax() interface{} func (h *MaxHeap) IsEmpty() bool func (h *MaxHeap) Replace(e interface{}) interface{} func (h *MaxHeap) Size() int Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type MaxHeap ¶ type MaxHeap struct { // contains filtered or unexported fields } func GetMaxHeapFromArr ¶ func GetMaxHeapFromArr(arr []interface{}) *MaxHeap func New ¶ func New() *MaxHeap func (*MaxHeap) Add ¶ func (h *MaxHeap) Add(e interface{}) 向堆中添加元素 func (*MaxHeap) ExtractMax ¶ func (h *MaxHeap) ExtractMax() interface{} 取出堆中最大元素 func (*MaxHeap) FindMax ¶ func (h *MaxHeap) FindMax() interface{} func (*MaxHeap) IsEmpty ¶ func (h *MaxHeap) IsEmpty() bool 返回一个布尔值, 表示堆中是否为空 func (*MaxHeap) Replace ¶ func (h *MaxHeap) Replace(e interface{}) interface{} 取出堆中的最大元素,并且替换成元素e func (*MaxHeap) Size ¶ func (h *MaxHeap) Size() int 返回堆中的元素个数 Source Files ¶ View all Source files maxheap.go Click to show internal directories. Click to hide internal directories.