javascript-algorithms icon indicating copy to clipboard operation
javascript-algorithms copied to clipboard

Update PriorityQueue.js

Open PradeepG-07 opened this issue 2 years ago • 3 comments

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

PradeepG-07 avatar Sep 15 '23 14:09 PradeepG-07

Hi @obafemitayor, Good to hear from you please merge the request if everything looks fine. Thank you.

PradeepG-07 avatar Oct 01 '23 12:10 PradeepG-07

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

obafemitayor avatar Oct 01 '23 15:10 obafemitayor

Lol 😄 That's okay

PradeepG-07 avatar Oct 01 '23 15:10 PradeepG-07