Re:Coding Interview Tips
by bpicolo on Wednesday October 16, 2013 @03:44PM
(#6561712)
Worst part is their max-stack isn't optimal. You can do it with O(1) additional space.
[ Parent
| on HN ]
Re:Coding Interview Tips
by BHSPitMonkey on Wednesday October 16, 2013 @06:08PM
(#6562410)
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).