If a part of this segment overlaps with the given range
Node left = query ( 2 * index + 1 , beg , mid , l , r ) ; Node right = query ( 2 * index + 2 , mid + 1 , end , l , r ) ; if ( left . max_set_bits > right . max_set_bits ) { result . max_set_bits = left . max_set_bits ; result . value = left . value ; } else if ( right . max_set_bits > left . max_set_bits ) { result . max_set_bits = right . max_set_bits ; result . value = right . value ; } else { result . max_set_bits = left . max_set_bits ; result . value = max ( right . value , left . value ) ; }