Order the answer to: KNN is a non-parametric learning algorithm. Its purpose is to use a database in which the data…