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