The algorithm divides the data into k groups which each group contains approximately same number of values. For the both methods, the best way of determining k is by looking at the histogram and try different intervals or groups.
The algorithm divides the data into k intervals of equal size. The width of intervals is: