insertWithOverflow

fun insertWithOverflow(newNode: Int, newScore: Float): Boolean

If the heap is not full (size is less than the initialSize provided to the constructor), adds a new node-and-score element. If the heap is full, compares the score against the current top score, and replaces the top element if newScore is better than (greater than unless the heap is reversed), the current top score.

Parameters

newNode

the neighbor node id

newScore

the score of the neighbor, relative to some other node