void function ( String [ ] arg0 ) { int loc0 = StdIn . readInt ( ) ; UF loc1 = new UF ( loc0 ) ; while ( ! StdIn . isEmpty ( ) ) { int loc2 = StdIn . readInt ( ) ; int loc3 = StdIn . readInt ( ) ; if ( loc1 . connected ( loc2 , loc3 ) ) continue ; loc1 . union ( loc2 , loc3 ) ; StdOut . println ( loc2 + "srini_string" + loc3 ) ; } StdOut . println ( loc1 . count ( ) + "srini_string" ) ; }
reads in a an integer n and a sequence of pairs of integers between 0 and n-1 from standard input , where each integer in the pair represents some site ; if the sites are in different components , merge the two components and print the pair to standard output . concode_field_sep int count concode_elem_sep byte[] rank concode_elem_sep int[] id concode_field_sep boolean connected concode_elem_sep int find concode_elem_sep int count concode_elem_sep void union