Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why not store the items in a random order? This can be achieved by performing a sort using a random key. Sorting can be done as a background job, so that the list is always "reasonably" random.


The items are stored in a map in random order (Red -> 45, Blue -> 23 etc). The picture makes it easier to read by showing many red boxes but the actual implementation just stores a number for each item label.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: