Skip to content

Commit cc7a092

Browse files
committed
fix
1 parent d2ad15c commit cc7a092

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Algorithm_full_features/sort/Insertion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static void sort(Comparable[] a, int low, int high) {
4040

4141
// Rearrange the array in ascending order with a comparator
4242
public static void sort(Object[] a, Comparable comparator) {
43-
int n = a.length();
43+
int n = a.length;
4444
for(int i = 1; i < n; i++) {
4545
for(int j = i + 1; j > 0 && less(a[j], a[j - 1], comparator); j--) {
4646
exchange(a, j, j - 1);
@@ -63,7 +63,7 @@ public static void sort(Object[] a, int low, int high, Comparable comparator) {
6363
// do not change the original array a[]
6464
// Returns a permutation that gives the elements in the array in ascending order.
6565
public static int[] indexSort(Comparable[] a) {
66-
int n = a.length();
66+
int n = a.length;
6767
int[] index = new int[n];
6868
for(int i = 0; i < n; i++) {
6969
index[i] = i;

0 commit comments

Comments
 (0)