Skip to content

Commit c0a8a50

Browse files
committed
Added docstrings for documentation purposes
1 parent 44543f5 commit c0a8a50

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pygorithm/data_structures/stack.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33

44
# stack implementation
55
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+
myStack = Stack()
16+
myStack.push(10)
17+
myStack.push(2)
18+
print(myStack.pop())
19+
'''
620
def __init__(self, limit = 10):
721
'''
822
@param : limit: the stack size

0 commit comments

Comments
 (0)