Base Case
if ( not root ) : NEW_LINE INDENT return 0 NEW_LINE DEDENT if ( not root . left and not root . right ) : NEW_LINE INDENT if ( isEven ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT else : NEW_LINE INDENT return 0 NEW_LINE DEDENT DEDENT