Sublinear Sketches for Approximate Nearest Neighbor and Kernel Density Estimation