Based on the SDSS and SDSS-WISE quasar datasets, we put forward two schemes to estimate the photometric redshifts of quasars. Our schemes are based on the idea that the samples are firstly classified into subsamples by a classifier and then photometric redshift estimation of different subsamples is performed by a regressor. Random Forest is adopted as the core algorithm of the classifiers, while Random Forest and kNN are applied as the key algorithms of regressors. The samples are divided into two subsamples and four subsamples depending on the redshift distribution. The performance based on different samples, different algorithms and different schemes are compared. The experimental results indicate that the accuracy of photometric redshift estimation for the two schemes generally improve to some extent compared to the original scheme in terms of the percents in frac{|Delta z|}{1+z_{i}}<0.1 and frac{|Delta z|}{1+z_{i}}<0.2 and mean absolute error. Only given the running speed, kNN shows its superiority to Random Forest. The performance of Random Forest is a little better than or comparable to that of kNN with the two datasets. The accuracy based on the SDSS-WISE sample outperforms that based on the SDSS sample no matter by kNN or by Random Forest. More information from more bands is considered and helpful to improve the accuracy of photometric redshift estimation. Evidently it can be found that our strategy to estimate photometric redshift is applicable and may be applied to other datasets or other kinds of objects. Only talking about the percent in frac{|Delta z|}{1+z_{i}}<0.3, there is still large room for further improvement in the photometric redshift estimation.