class Node:
def __init__(self, data):
self.data = data
self.right_child = None
self.left_child = None
class Tree:
def __init__(self):
self.root = None
# returns pointer to node with min value
def find_min(self):
#### IMPLEMENT THIS FUNCTION BODY #####
def find_min(self):
current = self.root
while current and current.left_child:
current = current.left_child
return current
^^^ the algorithm for above function is basically based on fact that in BST, by design, the smallest value is the left most node (just like the largest is right most node)
class Node:
def __init__(self, data):
self.data = data
self.right_child = None
self.left_child = None
class Tree:
def __init__(self):
self.root = None
# returns pointer to node with min value
def find_min(self):
#### IMPLEMENT THIS FUNCTION BODY #####
class Node:
def __init__(self, data):
self.data = data
self.right_child = None
self.left_child = None
class Tree:
def __init__(self):
self.root = None
# returns pointer to node with min value
def find_min(self):
#### IMPLEMENT THIS FUNCTION BODY #####
def find_min(self):
current = self.root
while current and current.left_child:
current = current.left_child
return current
^^^ the algorithm for above function is basically based on fact that in BST, by design, the smallest value is the left most node (just like the largest is right most node)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 |