MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / top

Method top

Data Structures/Stack/Python/Stack.py:30–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.__head = self.__head.ref
29
30 def top(self):
31 # prints the topmost element, i.e, head in the case of LL
32 if self.isEmpty():
33 print("Stack is empty.")
34 return
35 print(self.__head.data)
36
37 def isEmpty(self):
38 return(self.__size == 0)

Callers 8

preOrderMethod · 0.45
inOrderMethod · 0.45
postOrderMethod · 0.45
zizag_traversalFunction · 0.45
Stack.pyFile · 0.45
prefix_to_infixFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

isEmptyMethod · 0.95
printFunction · 0.50

Tested by

no test coverage detected