Class Index | File Index

Classes


Class comb.collections.Heap


Extends comb.collections.Collection.

Defined in: Heap.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for Heap Implementations.
Field Summary
Field Attributes Field Name and Description
 
the current number of elements.
 
true if the Heap is empty.
 
the keys of all items in the heap.
 
the values contained in the heap.
Method Summary
Method Attributes Method Name and Description
 
Empty the heap.
 
Determine if the heap contains a particular key.
 
Determine if the heap contains a particular value.
 
insert(key, value)
Insert a key value into the key
 
peek()
Gets he value of the root node with out removing it.
 
Gets the key of the root node without removing it.
 
Print the heap.
 
Removes the root from the heap
Methods borrowed from class comb.collections.Collection:
concat, indexOf, join, lastIndexOf, slice, toString
Class Detail
comb.collections.Heap()
Base class for Heap Implementations.
Field Detail
{Number} count
the current number of elements.

{Boolean} isEmpty
true if the Heap is empty.

{Array} keys
the keys of all items in the heap.

{Array} values
the values contained in the heap.
Method Detail
clear()
Empty the heap.

{Boolean} containsKey(key)
Determine if the heap contains a particular key.
Parameters:
key
key to test.
Returns:
{Boolean} true if the key is contained in this heap.

{Boolean} containsValue(value)
Determine if the heap contains a particular value.
Parameters:
value
value to test.
Returns:
{Boolean} true if the value is contained in this heap.

insert(key, value)
Insert a key value into the key
Parameters:
key
value

peek()
Gets he value of the root node with out removing it.
Returns:
the value of the root

peekKey()
Gets the key of the root node without removing it.
Returns:
the key of the root

print()
Print the heap.

remove()
Removes the root from the heap
Returns:
the value of the root

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:06 GMT-0500 (CDT)