Module 6 · stack and queue: Last In First Out, First In First Out
When to Use stack, queue or a Plain vector, and When Not To
Free with an accountReading
Kenji writes every stack as a vector, because, he says, a vector is faster. Maria writes every line as a std::queue, and then her app has to show who is standing in the middle of it. Amara asks each of them one question: what did the job need? This lesson is her answer, with a chart, a flowchart and a measurement.
Checking what this lesson needs for you…
What is inside When to Use stack, queue or a Plain vector, and When Not To
- One question: who leaves first?
- The comparison chart
- The decision flowchart
- Kenji's claim, measured
- Why std::stack exists anyway
- When not to use either
- Recursion already uses a stack