Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
170050081-170050095-170050098-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
DODDI SAILENDRA BATHI BABU
170050081-170050095-170050098-git
Commits
76adf722
Commit
76adf722
authored
Aug 26, 2018
by
DIDDI SAI KIRAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change implementation to insertion-sort
parent
add2430f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
sorting.cpp
sorting.cpp
+20
-13
No files found.
sorting.cpp
View file @
76adf722
#include<iostream>
#include "sorting.h"
#include"sorting.h"
using
namespace
std
;
vector
<
int
>
sort_custom
(
vector
<
int
>
v1
){
int
i
,
j
;
int
n
=
v1
.
size
();
for
(
i
=
0
;
i
<
n
-
1
;
i
++
)
{
for
(
j
=
0
;
j
<
n
-
i
-
1
;
j
++
){
if
(
v1
[
j
]
>
v1
[
j
+
1
])
swap
(
v1
[
j
],
v1
[
j
+
1
]);
}
}
return
v1
;
}
\ No newline at end of file
vector
<
int
>
sort_custom
(
vector
<
int
>
a
){
int
i
,
key
,
j
;
int
n
=
a
.
size
();
for
(
i
=
1
;
i
<
n
;
i
++
)
{
key
=
a
[
i
];
j
=
i
-
1
;
while
(
j
>=
0
&&
a
[
j
]
>
key
)
{
a
[
j
+
1
]
=
a
[
j
];
j
=
j
-
1
;
}
a
[
j
+
1
]
=
key
;
}
return
a
;
}
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