Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Isn't std::list better for monotonic stack?

lejafilip

Aug 15, 2024

Push and pop for vector are expensive because we force processor for realocate memory every push and pop.

In list we have back() which is constant. W doesn't want iterate over list.

0

0

Comments
Comments