Spectral Algorithms Optimally Recover Planted Sub-structures