Memory-efficient approximate frequency count.