MCPcopy Create free account
hub / github.com/geekcomputers/Python / Insert_At_End

Method Insert_At_End

Detect_Remove_loop.py:11–19  ·  view source on GitHub ↗
(self, new_data)

Source from the content-addressed store, hash-verified

9 self.head = None
10
11 def Insert_At_End(self, new_data):
12 new_node = Node(new_data)
13 if self.head is None:
14 self.head = new_node
15 return
16 current = self.head
17 while current.next:
18 current = current.next
19 current.next = new_node
20
21 def Detect_and_Remove_Loop(self):
22 slow = fast = self.head

Callers 1

Calls 1

NodeClass · 0.70

Tested by

no test coverage detected