Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bpicolo
on Oct 16, 2013
|
parent
|
context
|
favorite
| on:
Coding Interview Tips
Worst part is their max-stack isn't optimal. You can do it with O(1) additional space.
BHSPitMonkey
on Oct 16, 2013
|
next
[–]
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).
gameguy43
on Oct 16, 2013
|
prev
[–]
Hm. How?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: