PriorityQueue.prototype.poll = function () {
    return !this.isEmpty() ? this._elements.shift() : null;
};