In-Memory Nearest Neighbor Search With Nanoelectromechanical Ternary Content-Addressable Memory