GitLab der Philipps-Universität Marburg
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nosql-dbs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannik Seus
nosql-dbs
Commits
834f58e7
Commit
834f58e7
authored
1 year ago
by
jannikseus
Browse files
Options
Downloads
Patches
Plain Diff
remove unnecessary code
parent
57530491
No related branches found
Branches containing commit
Tags
ue01_v01
No related merge requests found
Pipeline
#2961
failed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/umr/nosql/cola/ColaImpl.java
+0
-52
0 additions, 52 deletions
src/main/java/de/umr/nosql/cola/ColaImpl.java
with
0 additions
and
52 deletions
src/main/java/de/umr/nosql/cola/ColaImpl.java
+
0
−
52
View file @
834f58e7
...
...
@@ -86,58 +86,6 @@ public class ColaImpl implements COLAInsert<Integer, String> {
return
mergedArray
;
}
public
static
ColaElement
[]
merge_sort
(
ColaElement
[]
unsortedArray
)
{
if
(
unsortedArray
.
length
>
1
)
{
int
mid
=
unsortedArray
.
length
/
2
;
ColaElement
[]
left
=
new
ColaElement
[
mid
];
for
(
int
i
=
0
;
i
<=
mid
-
1
;
i
++){
left
[
i
]
=
unsortedArray
[
i
];
}
ColaElement
[]
right
=
new
ColaElement
[
unsortedArray
.
length
-
mid
];
for
(
int
i
=
mid
;
i
<=
unsortedArray
.
length
-
1
;
i
++)
{
right
[
i
-
mid
]
=
unsortedArray
[
i
];
}
left
=
merge_sort
(
left
);
right
=
merge_sort
(
right
);
return
verschmelze
(
left
,
right
);
}
else
{
return
unsortedArray
;
}
}
private
static
ColaElement
[]
verschmelze
(
ColaElement
[]
left
,
ColaElement
[]
right
)
{
ColaElement
[]
newLeft
=
new
ColaElement
[
left
.
length
+
right
.
length
];
int
indexLeft
=
0
;
int
indexRight
=
0
;
int
indexRes
=
0
;
while
(
indexLeft
<
left
.
length
&&
indexRight
<
right
.
length
)
{
if
(
left
[
indexLeft
].
compareTo
(
right
[
indexRight
])
<
0
)
{
newLeft
[
indexRes
]
=
left
[
indexLeft
];
indexLeft
+=
1
;
}
else
{
newLeft
[
indexRes
]
=
right
[
indexRight
];
indexRight
+=
1
;
}
indexRes
+=
1
;
}
while
(
indexLeft
<
left
.
length
)
{
newLeft
[
indexRes
]
=
left
[
indexLeft
];
indexLeft
+=
1
;
indexRes
+=
1
;
}
while
(
indexRight
<
right
.
length
)
{
newLeft
[
indexRes
]
=
right
[
indexRight
];
indexRight
+=
1
;
indexRes
+=
1
;
}
return
newLeft
;
}
public
static
void
main
(
String
[]
args
)
{
COLAInsert
<
Integer
,
String
>
colaInsert
=
new
ColaImpl
();
colaInsert
.
insertElement
(
1
,
"a"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment