Microsoft.Samples.Collections

Heap Members

Heap overview

Public Static Methods

Synchronized Returns a synchronized (thread-safe) wrapper for the Heap.

Public Instance Constructors

HeapOverloaded. Initializes a new instance of the Heap class.

Public Instance Properties

Count Returns a value indicating the number of objects in the heap. Read-only
IsSynchronized Gets a value indicating whether access to the heap is synchronized (thread-safe). As this is an unsynchronized heap, it will aways return false.
SyncRoot Gets an object that can be used to synchronize access to the heap

Public Instance Methods

Add Add an object to the heap maintaining its heap properties
Clear Removes all elements from the Heap.
Clone Create a copy of the heap containing the same object references
Contains Determines whether an element is in the Heap.
CopyTo Copy all the elements stored on the current heap to the specified one-dimensional array starting at the specified index
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
Extract Extract returns the highest value object from the heap
GetEnumerator Returns an enumerator that can iterate through the heap in an unordered fashion.
GetHashCode (inherited from Object)Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData Populates a SerializationInfo with the data needed to serialize the heap.
GetType (inherited from Object)Gets the Type of the current instance.
IsEmpty Test whether the heap is empty of elements.
Peek Look at the element at the top of the heap without removing it.
ToString (inherited from Object)Returns a String that represents the current Object.

Protected Instance Constructors

HeapOverloaded. Initializes a new instance of the Heap class.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

Explicit Interface Implementations

ICloneable.Clone Create a copy of the heap containing the same object references
IEnumerable.GetEnumerator Returns an enumerator that can iterate through the heap in an unordered fashion.

See Also

Heap Class | Microsoft.Samples.Collections Namespace