The title describes all the numbers in an array of length n in the range of 0 to n-1. Some of the numbers in the array are duplicates, but it is not known that several numbers are duplicates. I don't know how many times each number repeats. Please find any duplicate numbers in the array. For example, if you enter an array of length 7 {2,3,1,0,2,5,3}, then the corresponding output is a repeating number of 2 or 3.
1/* 2 * Ideas: 3 * Find duplicate numbers in an array: 4 * This problem has a well-defined array of numbers that are not larger than the length of the array and are greater than 0, so you can do so with a hash table, so that the memory will not be out of bounds 5 * 6 * bitmap
: 7 * A bitmap array with an array length is applied and initialized to 0, just as the index of each number can be indexed as an array, and then the value of the bitmap array appears as the number of times the index position numbers appear.
8 * Finally sweep through the bitmap array, find the first value greater than 1.
9 * 10 * can be used in the Java data structure HashMap do, but there is no meaning, no use of the characteristics of the topic.
11 * Programming is a special case to consider a particular data structure. * * * Public boolean duplicate (int numbers[],int length,int [] duplication)-{if (length <= 1) (+ +) (false;) + int bitmapnumber[] = new Int[lengt
h];
(int i = 0; i < length; i++) (bitmapnumber[i] = 0; 26} 27 (int i = 0; i < length; i++) {bitmapnumber[numbers[i]]++; 31 } for (int i = 0; i < length; i++) (Bitmapnumber[i ] > 1) [duplication[0] = I
Max. return true;
A. " 46}