MCPcopy
hub / github.com/qiyuangong/leetcode / push

Method push

python/225_Implement_Stack_using_Queues.py:54–65  ·  view source on GitHub ↗

:type x: int :rtype: nothing

(self, x)

Source from the content-addressed store, hash-verified

52 self.curr_top = 0
53
54 def push(self, x):
55 """
56 :type x: int
57 :rtype: nothing
58 """
59 self.queue2.append(x)
60 self.curr_top = x
61 while len(self.queue1):
62 self.queue2.append(self.queue1.pop(0))
63 temp = self.queue2
64 self.queue2 = self.queue1
65 self.queue1 = temp
66
67 def pop(self):
68 """

Callers 5

sumOfLeftLeavesMethod · 0.95
dfsMethod · 0.95
maxAreaOfIslandMethod · 0.95

Calls 1

popMethod · 0.45

Tested by

no test coverage detected