Sep 5, 2024
new()
: Create a new dynamic set.insert(S, V)
: Insert element V into set S.remove(S, V)
: Remove element V from set S.contains(S, V)
: Check if element V is in set S (returns Boolean).new()
: Create a new stack.push(o)
: Add element o to the top of the stack.pop()
: Remove the top element from the stack.top()
: Return the top element (without removing it).size()
: Return the number of elements in the stack.isEmpty()
: Check if the stack is empty.top()
after a push(v)
should return v.throw
to signal errors and try/catch
blocks to handle them.eatPizza()
throws StomachAcheException
if too much pizza is consumed.