One could compute the distances between all the pairs of points, of which there are "n(n-1)/2", then pick the pair with the smallest distance. This brute-force algorithm takes O("n"2) time; i.e. its execution time is proportional to the square of the number of points. A classic result in computational geometry was the formulation of an algorithm that takes O("n" log "n"). Randomized algorithms that take O("n") expected time, as well as a deterministic algorithm that takes O("n" log log "n") time, have also been discovered.