Condition to check the maximum set bits is greater in two subtrees
if ( tree [ 2 * index + 1 ] . max_set_bits > tree [ 2 * index + 2 ] . max_set_bits ) { tree [ index ] . max_set_bits = tree [ 2 * index + 1 ] . max_set_bits ; tree [ index ] . value = tree [ 2 * index + 1 ] . value ; } else if ( tree [ 2 * index + 2 ] . max_set_bits > tree [ 2 * index + 1 ] . max_set_bits ) { tree [ index ] . max_set_bits = tree [ 2 * index + 2 ] . max_set_bits ; tree [ index ] . value = tree [ 2 * index + 2 ] . value ; }