Commit 5f9fe82e authored by LAKSHYA KUMAR's avatar LAKSHYA KUMAR

add basic implementation

parent c35b8263
#include <iostream>
#include "sorting.h"
using namespace std;
vector<int> sort_custom(vector<int> v)
{
for(int i = 0; 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment