Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f7eca49

Browse files
Merge pull request #291 from mjolewis/develop
Test: unit tests
2 parents ff4c245 + f015b9a commit f7eca49

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
-16 Bytes
Binary file not shown.

‎Data Structures with Java/Code/src/edu/bostonuniversity/playground/Playground.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ public class Playground{
44
private static void insertionsort(int[] data, int n) {
55
int i, lt;
66

7-
for (i = 1; i <= n; i++) {
7+
for (i = 1; i <= n; i++) {
88
lt = i - 1;
9-
while (lt>= 0 && data[lt] > data[i]) { swap(data, lt--, i--); }
9+
while (lt>= 0 && data[lt] > data[i]) { swap(data, lt--, i--); }
1010
}
1111
}
1212

@@ -24,7 +24,6 @@ private static int partition(int[] data, int lo, int hi) {
2424
else if (data[j] == pivot) { pivotIndex = j; }
2525
else { pivotIndex = k; }
2626

27-
2827
swap(data, lo, pivotIndex);
2928
return pivot;
3029
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /