aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csci1913/Java/project2_strap012.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/csci1913/Java/project2_strap012.java b/csci1913/Java/project2_strap012.java
index bc50856..ee09265 100644
--- a/csci1913/Java/project2_strap012.java
+++ b/csci1913/Java/project2_strap012.java
@@ -62,22 +62,21 @@ class Sort {
//Halving phase
int step = 1;
while (unsorted != null) {
- // Node tL = left, tR = right;
if (step % 2 == 0) { //Odd case
if (right == null) {
right = unsorted;
} else {
- right.next=unsorted;
+
}
} else { //Even case
- if (right == null) {
+ if (left == null) {
left = unsorted;
} else {
- left.next=unsorted;
+
}
}
- unsorted = unsorted.next;
step++;
+ unsorted = unsorted.next;
}
}