Compute entropy based on algorithm used.