Commit 8baca9c7 authored by saad.aswad's avatar saad.aswad

Merge branch 'task1'

# Conflicts:
#	.idea/workspace.xml
parents 397a487e 7f1f983c
......@@ -21,4 +21,17 @@ public abstract class SortList {
}
}
public boolean checkSorted() {
Entry current = this.head.next;
while (current.next != null) {
if (current.object.compareTo(current.next.object) > 0) {
return false;
}
current = current.next;
}
return true;
}
}
......@@ -61,6 +61,9 @@ public class SyncListTest extends TestCase {
long listLengthAfterAdds = list.length;
System.out.println("Length of the list after adding: "+listLengthAfterAdds);
String listIsSorted = list.checkSorted() ? "The List is sorted" : "The list is not sorted";
System.out.println(listIsSorted);
long startC = System.currentTimeMillis();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment