Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Schankula
2XB3FinalProject
Commits
20a9e048
Commit
20a9e048
authored
7 years ago
by
Lawrence Chung
Browse files
Options
Downloads
Patches
Plain Diff
mergeSort draft
parent
c6953ff0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sort/mergeSort.java
+10
-10
10 additions, 10 deletions
src/sort/mergeSort.java
with
10 additions
and
10 deletions
src/sort/mergeSort.java
+
10
−
10
View file @
20a9e048
package
sort
;
public
class
mergeSort
implements
GeneralCompare
{
private
static
General
Compare
[]
aux
;
public
class
mergeSort
{
private
static
Compar
abl
e
[]
aux
;
public
static
void
merge
(
GeneralCompare
[]
gc
,
int
n
){
public
static
void
merge
(
Comparable
x
,
int
n
,
GeneralCompare
gc
){
aux
=
new
General
Compare
[
n
];
aux
=
new
Compar
abl
e
[
n
];
if
(
n
<=
1
)
return
;
...
...
@@ -20,13 +20,13 @@ public class mergeSort implements GeneralCompare{
for
(
int
k
=
1
;
k
<=
n
;
k
++){
if
(
i
>
j
-
1
)
gc
[
k
]
=
aux
[
j
++];
x
[
k
]
=
aux
[
j
++];
else
if
(
j
>
n
)
gc
[
k
]
=
aux
[
i
++];
else
if
(
compare
(
aux
[
j
+
1
],
aux
[
1
])
<
0
)
// ?
gc
[
k
]
=
aux
[
j
++];
x
[
k
]
=
aux
[
i
++];
else
if
(
gc
.
compare
(
aux
[
j
+
1
],
aux
[
1
])
<
0
)
// ?
x
[
k
]
=
aux
[
j
++];
else
gc
[
k
]
=
aux
[
i
++];
x
[
k
]
=
aux
[
i
++];
}
}
...
...
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