The two sets, set1, set2 all store 10,000 long data. Is there a fast way to determine that the values stored in the two sets are the same? Is the value of set1 in set2, and the value of set2 All in set1?
Sort the two SETs in the way you want, and then scan from the first to the last, and see if the values corresponding to the first sequence numbers are equal to indicate whether the two SETs are the same.