Commit 1dacc156 authored by SABBITHI NAREN RAHUL's avatar SABBITHI NAREN RAHUL

add basic implementation

parent 1998cd82
#include<iostream>
#include<vector>
#include "sorting.h"
#include "sorting.cpp"
using namespace std;
int main(){
int n;
......
#include<iostream>
#include<vector>
#include "sorting.h"
using namespace std;
vector<int> sort_custom(vector<int> c){
bool pass = false; //have we passed through the cay without a swap?
int temp;
while (!pass){
pass = true;
for (int i=0; i<c.size()-1; i++){
if (c[i] > c[i+1]){
pass = false;
temp = c[i];
c[i] = c[i+1];
c[i+1] = temp;
}
}
}
return c;
}
#include<iostream>
#include<vector>
using namespace std;
vector<int> sort_custom(vector<int>);
vector<int> sort_custom(vector<int>d);
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