Sorts the data and removes distinct values. @return self reference
()
| 236 | * @return self reference |
| 237 | */ |
| 238 | public IntList ddo() { |
| 239 | if(!isEmpty()) { |
| 240 | sort(); |
| 241 | int i = 1; |
| 242 | for(int j = 1; j < size; ++j) { |
| 243 | while(j < size && list[i - 1] == list[j]) j++; |
| 244 | if(j < size) list[i++] = list[j]; |
| 245 | } |
| 246 | size = i; |
| 247 | } |
| 248 | return this; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Sorts the data and returns an array with offsets to the sorted array. |