Embercode
✕
Stacks and QueuesQuick quiz

Min and max stacks

6 questions. Covers Min stack and max stack in Python.

Questions 1 to 5 of 6

  1. 1. After the pushes 5, 3, 7, 3, 1, why is the 7 not copied to mins?
  2. 2. Why does push use <= instead of <?
  3. 3. What does this print, using MinStack from this lesson? ``python s = MinStack() s.push(6) s.push(2) s.push(2) s.pop() s.pop() print(s.min()) ``
  4. 4. What does this print, using MaxStack from worked example 3 of this lesson? ``python s = MaxStack() s.push(2) s.push(7) s.push(7) s.push(3) s.pop() s.pop() print(s.max()) ``
  5. 5. Which statements about the MinStack in this lesson are true? Pick all that apply.

    Pick every answer that is true.

5 question(s) left on this page.