Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
18305R006-18305R009-18305R010-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
RAMEESH PAUL
18305R006-18305R009-18305R010-git
Commits
c79408ec
Commit
c79408ec
authored
Sep 21, 2018
by
Abhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change implementation to insertion-sort
parent
0ea14c1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
sorting.cpp
sorting.cpp
+12
-12
No files found.
sorting.cpp
View file @
c79408ec
...
...
@@ -3,17 +3,17 @@
using
namespace
std
;
vector
<
int
>
sort_custom
(
vector
<
int
>
v
){
int
i
,
j
;
int
n
=
v
.
size
();
for
(
i
=
0
;
i
<
n
-
1
;
i
++
){
for
(
j
=
0
;
j
<
n
-
i
-
1
;
j
++
){
if
(
v
[
j
]
>
v
[
j
+
1
]){
int
temp
;
temp
=
v
[
j
];
v
[
j
]
=
v
[
j
+
1
];
v
[
j
+
1
]
=
temp
;
}
}
int
value
,
j
=
0
;
for
(
int
i
=
1
;
i
<
v
.
size
();
i
++
)
{
value
=
v
[
i
];
j
=
i
-
1
;
while
(
j
>=
0
&&
v
[
j
]
>
value
)
{
v
[
j
+
1
]
=
v
[
j
];
j
=
j
-
1
;
}
v
[
j
+
1
]
=
value
;
}
return
v
;
}
\ No newline at end of file
}
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