What is the k-nearest neighbours (kNN) algorithm and how is it applied to Machine Learning?