Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
ConcurrentSortedLinkedList
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
saad.aswad
ConcurrentSortedLinkedList
Commits
8baca9c7
Commit
8baca9c7
authored
Nov 10, 2025
by
saad.aswad
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task1'
# Conflicts: # .idea/workspace.xml
parents
397a487e
7f1f983c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
SortList.java
src/main/java/SortList.java
+13
-0
SyncListTest.java
src/test/java/SyncListTest.java
+3
-0
No files found.
src/main/java/SortList.java
View file @
8baca9c7
...
...
@@ -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
;
}
}
src/test/java/SyncListTest.java
View file @
8baca9c7
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment