#NEWLINE# def build_tree( self , s , e ) : #NEWLINE# #INDENT# '\n        segment: [s, e)\n        ' #NEWLINE# if ( s >= e ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( ( s + 1 ) == e ) : #NEWLINE# #INDENT# return Node ( self , e , self . A [ s ] ) #NEWLINE# #UNINDENT# left = self . build_tree ( s , ( ( s + e ) / 2 ) ) #NEWLINE# right = self . build_tree ( ( ( s + e ) / 2 ) , e ) #NEWLINE# val = DEFAULT #NEWLINE# if left : #NEWLINE# #INDENT# val = f ( val , left . m ) #NEWLINE# #UNINDENT# if right : #NEWLINE# #INDENT# val = f ( val , right . m ) #NEWLINE# #UNINDENT# root = Node ( s , e , val ) #NEWLINE# root . left = left #NEWLINE# root . right = right #NEWLINE# return root