• + 0 comments

    one query: If stack is empty then peek should return null. Is there any need for this check "!stack.empty() "