k-nearest algorithm implemented

See Below.