HeapNode

Represents a node in the inner structure of MinimumHeap/MaximumHeap.

The node can be detached by removing the corresponding place from the collection it was defined in. In that case only its element and priority are preserved and other methods and properties throw DetachedNodeException.

See also

Inheritors

Properties

Link copied to clipboard
abstract override var element: Element

Returns element corresponding to that node. Change of the element changes the corresponding element in the structure.

Link copied to clipboard
abstract val isDetached: Boolean

Indicates if the node is detached from the structure it was a part of.

Link copied to clipboard
abstract override var priority: Priority

Returns priority corresponding to that node. Change of the priority changes the corresponding priority in the structure and changes the inner structure to satisfy the heap property.

Functions

Link copied to clipboard
abstract operator override fun equals(other: Any?): Boolean

Legacy equality operation. Must return the result of referential equality.

Link copied to clipboard
abstract override fun hashCode(): Int

Legacy hash computation operation. Must return any Int value.

Link copied to clipboard
abstract fun remove()

Removes the corresponding place from the heap and detaches the node.

Link copied to clipboard
abstract override fun toString(): String

Represents the heap entry as a string. Must return a string in the following form.