Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Using Size() method to check stack empty, removed unnecessary class v…
Browse files Browse the repository at this point in the history
…ariable declaration
  • Loading branch information
yavinash committed Apr 22, 2016
1 parent 768cea7 commit 79d3a93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions algorithms/data_structures/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class Stack:
stack_list = []

def __init__(self):
self.stack_list = []
Expand Down Expand Up @@ -39,7 +38,7 @@ def is_empty(self):
Time Complexity: O(1)
"""
return not len(self.stack_list)
return not self.size()

def size(self):
"""
Expand Down

0 comments on commit 79d3a93

Please sign in to comment.