We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4557474 commit 8b2c01fCopy full SHA for 8b2c01f
stack_impl.py
@@ -7,6 +7,9 @@ def __init__(self):
7
self.items = []
8
9
def stack_length(self):
10
+ """
11
+ Finds length of the given stack
12
13
l = len(self.items)
14
if not self.items:
15
return "Empty Stack"
@@ -17,10 +20,16 @@ def stack_length(self):
17
20
pass
18
21
19
22
def push(self, value):
23
24
+ Push value to the stack
25
26
self.items.append(value)
27
return self.items
28
29
def pop(self):
30
31
+ Pops element from the stack
32
33
34
return None
35
else:
@@ -35,6 +44,9 @@ def peek(self):
44
return self.items[-1]
36
45
37
46
def min_element(self, stack_values):
47
48
+ Returns the smallest element in the stack
49
38
50
self.items = stack_values
39
51
40
52
print("Empty Stack")
0 commit comments