Closed hsanchez closed 9 years ago
Renaming loBound (from si) left a[si] = a[i - 1]; a[i - 1] = pivot; qsort(a, si, i - 2); qsort(a, i, hiBound);
untouched. That is why I had to manually edit the array parameter.
The problem is that array indexes are not inspected; therefore, if the param name is an array index, then it won't be renamed.
Here is the code snippet.
class Quicksort { public static void qsort(int[] arrayOfIntegers, int si, int ei) { if (ei <= si || si >= ei) { } else { int pivot = arrayOfIntegers[si]; int i = si + 1; int tmp; for (int j = si + 1; j <= ei; j++) { if (pivot > arrayOfIntegers[j]) { tmp = arrayOfIntegers[j]; arrayOfIntegers[j] = arrayOfIntegers[i]; arrayOfIntegers[i] = tmp; i++; } } arrayOfIntegers[si] = arrayOfIntegers[i - 1]; arrayOfIntegers[i - 1] = pivot; qsort(arrayOfIntegers, si, i - 2); qsort(arrayOfIntegers, i, ei); } } }
fixed in #33
Renaming loBound (from si) left a[si] = a[i - 1]; a[i - 1] = pivot; qsort(a, si, i - 2); qsort(a, i, hiBound);
untouched. That is why I had to manually edit the array parameter.
The problem is that array indexes are not inspected; therefore, if the param name is an array index, then it won't be renamed.
Here is the code snippet.