The constructive kernel algorithm for approximation of probability densities using the given sample values is proposed. This algorithm is based on the approaches of the theory of the numerical functional approximation. The critical analysis of the optimization criterion for the kernel density estimators (based on decrease of upper boundary of mean square error) is conducted. It is shown that the constructive kernel algorithm is nearly equal to the randomized projection-mesh functional numerical algorithm for approximation of the solution of the Fredholm integral equation of the second kind. In connection with this it is proposed to use the criterion of conditional optimization of functional algorithms for the kernel algorithm for approximation of probability densities. This criterion is based on minimization of the algorithm’s cost for the fixed level of error. The corresponding formulae for the conditionally optimal parameters of the kernel algorithm are derived.