Find the mid
tm = int ( ( tl + tr ) / 2 ) NEW_LINE if ( pos <= tm ) : NEW_LINE INDENT update ( v * 2 , tl , tm , pos , new_val ) NEW_LINE DEDENT else : NEW_LINE INDENT update ( v * 2 + 1 , tm + 1 , tr , pos , new_val ) NEW_LINE DEDENT