the training set needs to be compared n - 1 times and not n times