diff --git a/11.BucketSort.cpp b/11.BucketSort.cpp new file mode 100644 index 0000000..d7d5315 --- /dev/null +++ b/11.BucketSort.cpp @@ -0,0 +1,47 @@ +/* + * This program takes an array from the user + * sorts it using bucket sort + * Prints the sorted array + * For more information about Bucket Sort Algorithm: https://en.wikipedia.org/wiki/Bucket_sort + * + * Coded by: Abdurrezak EFE + * + * */ +#include +#include +#include +using namespace std; + +void bucket_sort(float arr[], int k) +{ + vector v[k]; //creating buckets + + int num; + for(int i=0;i> k; + + float arr[k]; + for(int i=0;i> arr[i]; + + bucket_sort(arr, k); //sorting + + for(int i=0;i