From 3d02ccd86ae7745fb0bc82507c3622b50775d2db Mon Sep 17 00:00:00 2001 From: Abhya Tripathi Date: Sun, 20 Oct 2019 15:16:08 +0530 Subject: [PATCH] Create FloydCycleDetection --- FloydCycleDetection | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 FloydCycleDetection diff --git a/FloydCycleDetection b/FloydCycleDetection new file mode 100644 index 0000000..478dca8 --- /dev/null +++ b/FloydCycleDetection @@ -0,0 +1,36 @@ +/* C++ Program - Bubble Sort */ + +#include +#include +void main() +{ + clrscr(); + int n, i, arr[50], j, temp; + cout<<"Enter total number of elements :"; + cin>>n; + cout<<"Enter "<>arr[i]; + } + cout<<"Sorting array using bubble sort technique...\n"; + for(i=0; i<(n-1); i++) + { + for(j=0; j<(n-i-1); j++) + { + if(arr[j]>arr[j+1]) + { + temp=arr[j]; + arr[j]=arr[j+1]; + arr[j+1]=temp; + } + } + } + cout<<"Elements sorted successfully..!!\n"; + cout<<"Sorted list in ascending order :\n"; + for(i=0; i