Closed Suiyueemperor closed 11 months ago
bug: CycleSort if (arr[i] < n && arr[i] != arr[correctpos])->if (arr[i] <= n && arr[i] != arr[correctpos]) eg. [5 4 2 1 3] , when i = 0, arr[i] < n is false.
I proposed this improvement in https://github.com/iluwatar/30-seconds-of-java/issues/194
PR: https://github.com/iluwatar/30-seconds-of-java/pull/195
bug: CycleSort if (arr[i] < n && arr[i] != arr[correctpos])->if (arr[i] <= n && arr[i] != arr[correctpos]) eg. [5 4 2 1 3] , when i = 0, arr[i] < n is false.