DEV Community

Discussion on: Stacks vs. Queues In JavaScript

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

If I were to be pedantic, and you know how I love to be when it comes to complexity, hash maps don't have O(1) amortized push time. They have O(1) average-input (possibly amortized) push time. :)

Thread Thread
 
nestedsoftware profile image
Nested Software • Edited

Sigh. Yes, I believe it’s both! 😅