2 ms·He keeps the sorted frequency count. It doesn't have to be the top 10. You can query arbitrary k.by ok123456 3y agoHe keeps the sorted frequency count. It doesn't have to be the top 10. You can query arbitrary k.