An effective algorithm to compute Mandelbrot sets in parameter planes