mourner / tinyqueue

The smallest and simplest priority queue in JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README is inconsistent

neomilium opened this issue · comments

Hello,

I noticed a bug in your README:

// add some items
queue.push(7);
queue.push(5);
queue.push(10);

// remove the top item
var top = queue.pop(); // returns 5

If it returns 5, its not the top. If its the top, documentation should say returns 7.

Does I miss something?

This is a sorted queue. In this case the "top" refers to the smallest number pushed up to that point.

OK, thanks.
Maybe that point could be explicitly described in README.