Skip to content

Commit

Permalink
Added time complexity for size method
Browse files Browse the repository at this point in the history
  • Loading branch information
nbro committed Feb 4, 2017
1 parent 212f5ba commit ecf1608
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ands/ds/Stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def pop(self) -> object:
return None if self.is_empty() else self._stack.pop()

def size(self) -> int:
"""Returns the size of this stack."""
"""Returns the size of this stack.
**Time complexity:** O(1)."""
return len(self._stack)

def is_empty(self) -> bool:
Expand Down

0 comments on commit ecf1608

Please sign in to comment.