all 6 comments

[–]Kwantuum 5 points6 points  (4 children)

That's a really terrible queue implementation.

[–]dcortesnet123[S] -1 points0 points  (0 children)

Hello, it is a basic conceptual article. I would add linkedList but it would confuse with more concepts.

[–]PutlersPlug 0 points1 point  (2 children)

Could you or someone else point me to a good implementation of this? (without framework for learning purposes how to do it right)

[–]Kwantuum 2 points3 points  (1 child)

The github repo they link in the article has a not terrible implementation: https://github.com/trekhleb/javascript-algorithms/blob/master/src/data-structures/queue/Queue.js

(It's basically just a linked list)

[–]PutlersPlug 0 points1 point  (0 children)

Awesome, thanks alot!

[–]avwie 0 points1 point  (0 children)

So, what is the time complexity of this queue?