max_key variables are calculated using
max function respectively.
You may remove
None's, but there’s also
node.key (that’s probably always present) which becomes the new minimum/maximum.
You don’t always return
None, you do it only when the
but sir, we are not returning anything other than
The last two values are result of
max() functions. And they accept a list of up to three values. One of these values is
node.key which probably is always different than
That’s where the values (different than
None) are from.