Show / Hide Table of Contents

Class MaxHeap

A binary heap implementation that maintains the maximum element at the root.

Inheritance
object
MaxHeap
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EarleyParser
Assembly: EarleyParser.dll
Syntax
public class MaxHeap

Properties

| Edit this page View Source

Count

Gets the number of elements in the heap.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

Elements

Gets the elements in the heap.

Declaration
public List<int> Elements { get; }
Property Value
Type Description
List<int>
| Edit this page View Source

Max

Gets the maximum element in the heap.

Declaration
public int Max { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Add(int)

Adds a new element to the heap.

Declaration
public void Add(int value)
Parameters
Type Name Description
int value

The value to add.

| Edit this page View Source

Clear()

Removes all elements from the heap.

Declaration
public void Clear()
| Edit this page View Source

PopMax()

Removes and returns the maximum element from the heap.

Declaration
public int PopMax()
Returns
Type Description
int

The maximum element.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX