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

Method Remove_loop

Detect_Remove_loop.py:32–41  ·  view source on GitHub ↗
(self, Loop_node)

Source from the content-addressed store, hash-verified

30 return 0
31
32 def Remove_loop(self, Loop_node):
33 ptr1 = self.head
34 while 1:
35 ptr2 = Loop_node
36 while ptr2.next != Loop_node and ptr2.next != ptr1:
37 ptr2 = ptr2.next
38 if ptr2.next == ptr1:
39 break
40 ptr1 = ptr1.next
41 ptr2.next = None
42
43 def Display(self):
44 temp = self.head

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected