From 678e12d7fd03c639341adc1d9974a8d5f0f98e09 Mon Sep 17 00:00:00 2001 From: TANISHQ CHAMOLA <36632821+tanishqchamola@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:21:57 +0530 Subject: [PATCH] Add files via upload --- bubble.cpp | 47 +++++++++++++++++++++++++++++++++++ insertion.cpp | 48 +++++++++++++++++++++++++++++++++++ selection.cpp | 48 +++++++++++++++++++++++++++++++++++ stable_sort.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 209 insertions(+) create mode 100644 bubble.cpp create mode 100644 insertion.cpp create mode 100644 selection.cpp create mode 100644 stable_sort.cpp diff --git a/bubble.cpp b/bubble.cpp new file mode 100644 index 0000000..1364c55 --- /dev/null +++ b/bubble.cpp @@ -0,0 +1,47 @@ +#include +using namespace std; + +int main() +{ + cout<<"Enter no. of input: "; + int n; + int count=0; + srand(time(0)); + cin>>n; + unsigned short int arr[n]; + + for (int i=0; iarr[k]) + { + int temp= arr[j]; + arr[j] = arr[k]; + arr[k] = temp; + } + count++; + } + } + + for (int i=0; i +using namespace std; +/* +int main() +{ + cout<<"Enter no. of input: "; + int n; + int count=0; + srand(time(0)); + cin>>n; + unsigned short int arr[n]; + + for (int i=0; i=0 && arr[k]>arr[j]) + { + int temp = arr[j]; + arr[j] = arr[k]; + arr[k] = temp; + j--; + k--; + } + count++; + } + + for (int i=0; i +using namespace std; +/* +int main() +{ + cout<<"Enter no. of input: "; + int n; + int count=0; + srand(time(0)); + cin>>n; + unsigned short int arr[n]; + + for (int i=0; iarr[k]) + { + int temp= arr[j]; + arr[j] = arr[k]; + arr[k] = temp; + } + count++; + } + } + + for (int i=0; i +using namespace std; +/* +class num{ +public: + int data; + bool flag = false; +}; + +int min(num arr[],int n) +{ + int j=0; + while(arr[j].flag!=false) + { + j++; + } + int m = arr[j].data; + int index=j; + for (int l=0; l>n; + int sort[n]; + num arr[n]; + + for (int i=0; i>arr[i].data; + } + + for (int h=0; h