Closed Amorites closed 5 years ago
What would "toArray" do, precisely?
As a opposite operation of headpify. Convert the fpq to array in order.
Maybe like:
function transformFPQToArray(fpq) {
const temp = fpq.clone();
const ret = [];
while (!temp.isEmpty()) {
ret.push(temp.poll());
}
return ret;
}
Maybe
fpq.kSmallest(fpq.size)
is better
It's common to use array or object for rendering.