Condition to check if there is only one element in the array
if ( beg == end ) { tree [ index ] . value = a [ beg ] ; tree [ index ] . max_set_bits = setBits ( a [ beg ] ) ; } else { int mid = ( beg + end ) / 2 ;