We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44543f5 commit c0a8a50Copy full SHA for c0a8a50
pygorithm/data_structures/stack.py
@@ -3,6 +3,20 @@
3
4
# stack implementation
5
class Stack(object):
6
+ '''
7
+ 1. `push`: pushes an item on to the stack
8
+
9
+ myStack = Stack()
10
+ myStack.push(10)
11
+ print(myStack)
12
13
+ 2. `pop`: pops the topmost item of the stack
14
15
16
17
+ myStack.push(2)
18
+ print(myStack.pop())
19
20
def __init__(self, limit = 10):
21
'''
22
@param : limit: the stack size
0 commit comments