iluwatar / java-design-patterns-vuepress-web

Next generation website for Java Design Patterns
https://java-design-patterns.com
MIT License
261 stars 63 forks source link

30-seconds-of-java/CycleSort bug. #72

Closed Suiyueemperor closed 11 months ago

Suiyueemperor commented 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.

hammadsaedi commented 11 months ago

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