Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Please explain. Without maintaining that ordering, you're going to have to iterate over the entire stack after every pop, no? One of their requirements was to keep pop() at O(1) rather than O(n).


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: