MCPcopy Index your code
hub / github.com/BeeBombshell/Python-DSA / addTail

Method addTail

DSA/SinglyLinkedList.py:41–47  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

39
40 #method to add element in the last i.e. tail
41 def addTail(self, x):
42 new_node = Node(x)
43 if (self.isEmpty()):
44 self.head = self.tail = new_node
45 return
46 self.tail.next = new_node
47 self.tail = new_node
48
49 #method to insert an element at a specific position
50 def insert(self, x, pos):

Callers 2

insertMethod · 0.95

Calls 2

isEmptyMethod · 0.95
NodeClass · 0.70

Tested by

no test coverage detected