News for hackers. Stuff that matters.
Re:Who Wants to Be a Thousandaire? (2011) by kragen on Wednesday May 08, 2024 @03:39PM (#40302055)
in a single round of digit-pair radix sorting, you can put 100 piles of ≈1000 bills each into 10×10 cubbyholes, a piece of furniture which is small enough to fit on a desk. then you need about 20 minutes to linearly search through one such pile when the dj announces a number, which is probably fast enough to win

if you have a second cubbyhole array, when you linearly search through a pile chosen from the first cubbyhole array, you can radix-sort that pile by another two digits, dividing it into piles of ≈10 bills. those piles are small enough that you can keep them sorted as you build them without much loss of efficiency, even on a computer

if you can fill the first array with 100 wallets with 10 numbered tabs each, like the tabbed dividers in a looseleaf notebook, you can divide the bills into 1000 piles on the first radix-sorting pass. in practice it might be too much work to find or make the wallets

but i think the sad thing about michael larson's story is not that he didn't know enough about computer 'science' (or, i guess, library 'science'), but that he spent more effort searching for a hack that would make hard things easy than it would have taken to do them the hard way, destroying his personal relationships in the process

There are no comments on this comment yet.