Added stack method is_empty().

This commit is contained in:
Donne Martin
2015-05-23 17:01:45 -04:00
parent 062d27987c
commit 273d0efcb4
2 changed files with 26 additions and 5 deletions

View File

@@ -23,4 +23,7 @@ class Stack(object):
def peek(self):
if self.top is not None:
return self.top.data
return None
return None
def is_empty(self):
return self.peek() is None