Models of neutron and strange stars are considered in the approximation of a uniform density distribution. A universal algebraic equation, valid for any equation of state, is used to find the approximate mass of a star of a given density without resorting to the integration of differential equations. Equations of state for neutron stars had been taken for degenerate neutron gas and for more realistic ones, used by Bethe, Malone, Johnson (1975). Models of homogeneous strange stars for the equation of state in the "quark bag model" have a simple analytical solution. The solutions presented in the paper for various equations of state differ from the exact solutions obtained by the numerical integration of differential equations by at most ∼ 20%. The formation of strange stars is examined as a function of the deconfinement boundary (DB), at which quarks become deconfined. Existing experimental data indicate that matter reaches very high densities in the vicinity of the DB. This imposes strong constraints on the maximum mass of strange stars and prohibits their formation at the final stages of stellar evolution, because the limiting mass of neutron stars is substantially higher and corresponds to considerably lower matter densities.