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
7f1f983c
Commit
7f1f983c
authored
Nov 10, 2025
by
saad.aswad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List length, sorting in Adding implementations.
parent
c9239d66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
17 deletions
+37
-17
workspace.xml
.idea/workspace.xml
+21
-17
SortList.java
src/main/java/SortList.java
+13
-0
SyncListTest.java
src/test/java/SyncListTest.java
+3
-0
No files found.
.idea/workspace.xml
View file @
7f1f983c
...
@@ -4,7 +4,11 @@
...
@@ -4,7 +4,11 @@
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"3f4b2924-17d7-4794-bacf-d51c4f0be8bb"
name=
"Changes"
comment=
"List length, sorting in Adding implementations."
/>
<list
default=
"true"
id=
"3f4b2924-17d7-4794-bacf-d51c4f0be8bb"
name=
"Changes"
comment=
"List length, sorting in Adding implementations."
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/SortList.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/SortList.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/test/java/SyncListTest.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/test/java/SyncListTest.java"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
...
@@ -28,9 +32,9 @@
...
@@ -28,9 +32,9 @@
<component
name=
"MarkdownSettingsMigration"
>
<component
name=
"MarkdownSettingsMigration"
>
<option
name=
"stateVersion"
value=
"1"
/>
<option
name=
"stateVersion"
value=
"1"
/>
</component>
</component>
<component
name=
"ProjectColorInfo"
>
<![CDATA[
{
<component
name=
"ProjectColorInfo"
>
{
"associatedIndex"
: 2
"
associatedIndex
"
: 2
}
]]>
</component>
}
</component>
<component
name=
"ProjectId"
id=
"2NMPKhBDgdyw9qxmyQBX74HdmhD"
/>
<component
name=
"ProjectId"
id=
"2NMPKhBDgdyw9qxmyQBX74HdmhD"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
>
<ConfirmationsSetting
value=
"2"
id=
"Add"
/>
<ConfirmationsSetting
value=
"2"
id=
"Add"
/>
...
@@ -39,20 +43,20 @@
...
@@ -39,20 +43,20 @@
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
</component>
</component>
<component
name=
"PropertiesComponent"
>
<![CDATA[
{
<component
name=
"PropertiesComponent"
>
{
"keyToString"
: {
"
keyToString
"
: {
"ASKED_ADD_EXTERNAL_FILES": "true"
,
"
ASKED_ADD_EXTERNAL_FILES
"
:
"
true
"
,
"JUnit.SyncListTest.testRun.executor": "Run"
,
"
JUnit.SyncListTest.testRun.executor
"
:
"
Run
"
,
"RunOnceActivity.OpenProjectViewOnStart": "true"
,
"
RunOnceActivity.OpenProjectViewOnStart
"
:
"
true
"
,
"RunOnceActivity.ShowReadmeOnStart": "true"
,
"
RunOnceActivity.ShowReadmeOnStart
"
:
"
true
"
,
"SHARE_PROJECT_CONFIGURATION_FILES": "true"
,
"
SHARE_PROJECT_CONFIGURATION_FILES
"
:
"
true
"
,
"git-widget-placeholder": "task1"
,
"
git-widget-placeholder
"
:
"
task1
"
,
"kotlin-language-version-configured": "true"
,
"
kotlin-language-version-configured
"
:
"
true
"
,
"project.structure.last.edited": "Modules"
,
"
project.structure.last.edited
"
:
"
Modules
"
,
"project.structure.proportion": "0.0"
,
"
project.structure.proportion
"
:
"
0.0
"
,
"project.structure.side.proportion": "0.0"
"
project.structure.side.proportion
"
:
"
0.0
"
}
}
}
]]>
</component>
}
</component>
<component
name=
"RunManager"
selected=
"JUnit.SyncListTest.testRun"
>
<component
name=
"RunManager"
selected=
"JUnit.SyncListTest.testRun"
>
<configuration
name=
"SyncListTest"
type=
"JUnit"
factoryName=
"JUnit"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"SyncListTest"
type=
"JUnit"
factoryName=
"JUnit"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"SortLinkedList"
/>
<module
name=
"SortLinkedList"
/>
...
...
src/main/java/SortList.java
View file @
7f1f983c
...
@@ -21,4 +21,17 @@ public abstract class SortList {
...
@@ -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 @
7f1f983c
...
@@ -61,6 +61,9 @@ public class SyncListTest extends TestCase {
...
@@ -61,6 +61,9 @@ public class SyncListTest extends TestCase {
long
listLengthAfterAdds
=
list
.
length
;
long
listLengthAfterAdds
=
list
.
length
;
System
.
out
.
println
(
"Length of the list after adding: "
+
listLengthAfterAdds
);
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
();
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