Open PradeepG-07 opened 9 months ago
Hi @obafemitayor, Good to hear from you please merge the request if everything looks fine. Thank you.
Hi @obafemitayor, Good to hear from you please merge the request if everything looks fine. Thank you.
@PradeepG-07 I am not sure I can though. I need to be a maintainer to do that
Lol 😄 That's okay
Changed the default priority of a item to value of the item if the priority is not provided manually in the add() method. Now it resolves the issue #1070 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); }); }); It polls out values as 1,2,3,4