Skip to content

Commit 486f356

Browse files
authored
edit decript
1 parent ec3f996 commit 486f356

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bucket-sort/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@
33
<div align="center">
44
<img src="https://github.com/iamlorddop/sorting-methods/blob/main/assets/img/bucket-sort.gif" alt="bucket-sort.gif">
55
</div>
6+
7+
Bucket sort is mainly useful when input is uniformly distributed over a range. For example, consider the following problem.
8+
Sort a large set of floating point numbers which are in range from 0.0 to 1.0 and are uniformly distributed across the range.
9+
10+
## How does Bucket Sort Work?
11+
12+
bucketSort(arr[], n)
13+
- Create n empty buckets (or lists).
14+
- Do following for every array element arr[i]. Insert arr[i] into bucket[n * array[i]]
15+
- Sort individual buckets using insertion sort.
16+
- Concatenate all sorted buckets.

0 commit comments

Comments
 (0)