Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
170050053-170050067-170050085-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
SUDHIR KUMAR
170050053-170050067-170050085-git
Commits
5d4dbb6b
Commit
5d4dbb6b
authored
Aug 27, 2018
by
LUKKA GOVINDA SIVA NAGADEV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change implementation to insertion-sort
parent
0fb676da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
sorting.cpp
sorting.cpp
+17
-12
No files found.
sorting.cpp
View file @
5d4dbb6b
...
...
@@ -2,16 +2,21 @@
#include<vector>
#include "sorting.h"
using
namespace
std
;
vector
<
int
>
sort_custom
(
vector
<
int
>
r
){
for
(
int
i
=
0
;
i
<
r
.
size
();
i
++
){
for
(
int
j
=
r
.
size
()
-
1
;
j
>=
i
;
j
--
){
if
(
r
[
j
-
1
]
>
r
[
j
]){
int
temp
;
temp
=
r
[
j
-
1
];
r
[
j
-
1
]
=
r
[
j
];
r
[
j
]
=
temp
;
}
}
}
return
r
;
vector
<
int
>
sort_custom
(
vector
<
int
>
data
)
{
int
i
,
j
,
tmp
;
for
(
i
=
1
;
i
<
data
.
size
();
i
++
)
{
j
=
i
;
tmp
=
data
[
i
];
while
(
j
>
0
&&
tmp
<
data
[
j
-
1
])
{
data
[
j
]
=
data
[
j
-
1
];
j
--
;
}
data
[
j
]
=
tmp
;
}
return
data
;
}
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