mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-02-03 02:24:47 +08:00
542 B
542 B
Stack
- Implementation of an interpreter for a small language that does multiplication/addition/etc.
- Design a
MinStackdata structure that supports amin()operation that returns the minimum value in the stack in O(1) time. - Write an algorithm to determine if all of the delimiters in an expression are matched and closed.
- E.g.
{ac[bb]},[dklf(df(kl))d]{}and{[[[]]]}are matched. But{3234[fdand{df][d}are not. - Source
- E.g.