Open
Description
describe('priorityQueue Test:', () => {
it('should return correct priorityQueue results:', () => {
const pq = new PriorityQueue();
pq.add(1);
pq.add(2);
pq.add(3);
pq.add(4);
expect(pq.toString()).toBe('1,2,3,4');
expect(pq.poll()).toBe(1);
expect(pq.poll()).toBe(2);
expect(pq.poll()).toBe(3);
expect(pq.poll()).toBe(4);
});
});
now it poll out 1, 4, 3, 2
, expected: 1,2,3,4
Metadata
Metadata
Assignees
Labels
No labels