Just to continue from the above example. I thought of a preliminary algorithm for large data samples:
1. Sort data in ascending order.
2. Group data where at least a group has 10 elements
3. Calculate and compare density to group similar ones together.
I got stuck on the 3rd point. Where I am not sure how to effectively group them. My obstacle comes from if the density increases slowly, but gradually e.g. Density: 1,2,3,4,5,6,7,8,9,10
Where do I call it break and say that one group has a different density from another.