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

Method addTail

DSA/DoublyLinkedList.py:33–42  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

31
32 #method to add an element in the last of the list i.e. tail
33 def addTail(self, x):
34 new_node = Node(x)
35 if (self.isEmpty()):
36 self.head = self.tail = new_node
37 new_node.next = None
38 return
39 self.tail.next = new_node
40 new_node.prev = self.tail
41 new_node.next = None
42 self.tail = new_node
43
44 #method to insert an element at a specific position
45 def insert(self, x, pos):

Callers 1

Calls 2

isEmptyMethod · 0.95
NodeClass · 0.70

Tested by

no test coverage detected