PriorityQueue = function(array, compare) {
    if (compare) {
        this.compare = compare;
    }

    if (array) {
        this.heap = array;
        for (var i = 0; i < Math.floor(this.heap.length / 2); i++) {
            this.siftUp(i);
        }
    }
    else {
        this.heap = [];
    }
}
Priority Queue based on python heapq module
http://svn.python.org/view/python/branches/release27-maint/Lib/heapq.py

@constructor
@param {Object[]} [array] Initial array of values to store.
@param {Function} [compare] Compare function.