Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
170050002-170050022-170050060-git
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MASHKARIA SATVIK MEHULBHAI
170050002-170050022-170050060-git
Commits
d857b114
Commit
d857b114
authored
Aug 26, 2018
by
ARPIT AGGARWAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update merge-sort to reflect API update
parent
2fac559b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
54 deletions
+54
-54
sorting.cpp
sorting.cpp
+54
-54
No files found.
sorting.cpp
View file @
d857b114
...
@@ -54,7 +54,7 @@ void mergeSort(int arr[], int l, int r)
...
@@ -54,7 +54,7 @@ void mergeSort(int arr[], int l, int r)
}
}
}
}
vector
<
int
>
sort_custom
(
vector
<
int
>
data
)
vector
<
int
>
sort_custom
(
vector
<
int
>
data
,
int
startidx
,
int
endidx
)
{
{
//vector<int> arr(data.begin(), data.end()) ;
//vector<int> arr(data.begin(), data.end()) ;
int
n
=
data
.
size
()
;
int
n
=
data
.
size
()
;
...
@@ -63,7 +63,7 @@ vector<int> sort_custom(vector<int> data)
...
@@ -63,7 +63,7 @@ vector<int> sort_custom(vector<int> data)
{
{
arr
[
i
]
=
data
[
i
]
;
arr
[
i
]
=
data
[
i
]
;
}
}
mergeSort
(
arr
,
0
,
n
-
1
)
;
mergeSort
(
arr
,
startidx
,
endidx
-
1
)
;
vector
<
int
>
res
(
arr
,
arr
+
n
)
;
vector
<
int
>
res
(
arr
,
arr
+
n
)
;
return
res
;
return
res
;
}
}
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