stack.size()与stack.empty()

to check whether a stack is empty, we can use if(stack.size()). Then why do we have stack.empty().
Is there any condition where these results may differ or any advantage of using one over other.

评论