Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
170050033-170050062-170050101-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
LAKSHYA KUMAR
170050033-170050062-170050101-git
Commits
a8f9232a
Commit
a8f9232a
authored
Aug 26, 2018
by
AMBATI SATVIK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change implementation to insertion-sort
parent
b440396f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
sorting.cpp
sorting.cpp
+13
-16
No files found.
sorting.cpp
View file @
a8f9232a
...
...
@@ -4,21 +4,18 @@ using namespace std;
vector
<
int
>
sort_custom
(
vector
<
int
>
v
)
{
for
(
int
i
=
0
;
i
<
v
.
size
();
i
++
)
int
i
,
key
,
j
;
for
(
i
=
1
;
i
<
v
.
size
();
i
++
)
{
int
count
=
0
;
for
(
int
j
=
0
;
j
<
v
.
size
()
-
1
;
j
++
)
{
if
(
v
[
j
]
>
v
[
j
+
1
])
{
count
++
;
int
temp
=
v
[
j
];
v
[
j
]
=
v
[
j
+
1
];
v
[
j
+
1
]
=
temp
;
}
}
if
(
count
==
0
)
{
return
v
;
}
}
return
v
;
key
=
v
[
i
];
j
=
i
-
1
;
while
(
j
>=
0
&&
v
[
j
]
>
key
)
{
v
[
j
+
1
]
=
v
[
j
];
j
=
j
-
1
;
}
v
[
j
+
1
]
=
key
;
}
return
v
;
}
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