get the pointer to node to delete and its parent (using helper method: get_node_with_parent(self, data), which returns (parent, node) ):
Here is the helper function implementation (as a bonus):
def __get_node_with_parent(self, data):
parent = None
current = self.root_node
while current:
if data == current.data:
return (parent, current)
parent = current
if data < current.data:
current = current.left_child
else:
current = current.right_child
return (None, None)
get the pointer to node to delete and its parent (using helper method: get_node_with_parent(self, data), which returns (parent, node) ):
Here is the helper function implementation (as a bonus):
def __get_node_with_parent(self, data):
parent = None
current = self.root_node
while current:
if data == current.data:
return (parent, current)
parent = current
if data < current.data:
current = current.left_child
else:
current = current.right_child
return (None, None)
status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|
repetition number in this series | 0 | memorised on | scheduled repetition | ||||
scheduled repetition interval | last repetition or drill |