A procedure for computing three-layer neural networks that classify pa
tterns using the nearest neighbor rule is presented. The procedure con
structs a neural network with expected O(n) neurons while requiring ex
pected O(n) computation time for n uniformly distributed training patt
erns.