union unites two disjoint sets into a single set . a union-by-size heuristic is used to choose the new root . this method will corrupt the data structure if root1 and root2 are not roots of their respective sets , or if they 're identical . concode_field_sep int[] array concode_field_sep int find concode_elem_sep void main
void function ( int arg0 , int arg1 ) { if ( array [ arg1 ] < array [ arg0 ] ) { array [ arg1 ] += array [ arg0 ] ; array [ arg0 ] = arg1 ; } else { array [ arg0 ] += array [ arg1 ] ; array [ arg1 ] = arg0 ; } }