I have been stuck on solving this task for quite a while. I need to write a recursive function to check whether that every node is smaller than any of its children. Returns true if the binary tree is a min-heap and false otherwise.
What i have so far:
def min_heap(t):
if t == None:
return True
else:
return t.left.value > t.value and t.right.value > t.value