MCPcopy
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / spliceOut

Method spliceOut

AVL.py:191–209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

189 self.delete(key)
190
191 def spliceOut(self):
192 if self.isLeaf():
193 if self.isLeftChild():
194 self.parent.leftChild = None
195 else:
196 self.parent.rightChild = None
197 elif self.hasAnyChildren():
198 if self.hasLeftChild():
199 if self.isLeftChild():
200 self.parent.leftChild = self.leftChild
201 else:
202 self.parent.rightChild = self.leftChild
203 self.leftChild.parent = self.parent
204 else:
205 if self.isLeftChild():
206 self.parent.leftChild = self.rightChild
207 else:
208 self.parent.rightChild = self.rightChild
209 self.rightChild.parent = self.parent
210
211 def findSuccessor(self):
212 succ = None

Callers 1

removeMethod · 0.45

Calls 4

isLeafMethod · 0.45
isLeftChildMethod · 0.45
hasAnyChildrenMethod · 0.45
hasLeftChildMethod · 0.45

Tested by

no test coverage detected