Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/careercup/ctci
/ push
Method
push
python/Chapter 3/Question3_5/3_5.py:56–58 ·
view source on GitHub ↗
(self, data)
Source
from the content-addressed store, hash-verified
54
self.size = 0
55
56
def
push(self, data):
57
self.stack = Node(data, self.stack)
58
self.size += 1
59
60
def
pop(self):
61
assert self.stack.data is not None,
'Stack is empty'
Callers
2
eq
Method · 0.45
rebuild
Method · 0.45
Calls
1
Node
Class · 0.70
Tested by
no test coverage detected