Live data from Hacker News

Ask HN: How have you applied computer science IRL?

news.ycombinator.com

11–20 of 39 posts

Re: Ask HN: How have you applied computer science IRL?

#11
post #10

Sorting room full of dated reports from several dozens of years. First pass: put raports in the bins year by year maintaining sort order in the bins. Binary search used to place new report in the bin. Second pass: put year by year sorted reports in the correct order on the shelfs. I don't remeber the name of the algorithm used and the book from which it come was given to the library.

I'd break the first pass down further, putting items into the (yearly) bins without sorting within each bin, freeing up bins, then subdividing them into smaller piles (say, by month), then sorting those.

This insight is courtesy of a sorting algorithm that's optimal for systems with very limited memory but multiple tape systems, if I remember correctly. Also IIRC insertion sort can beat doing the binary sort in situations of 7-20 or so? Much over a dozen, I can't use my fingers of one hand as bookmarks to do, say, three comparisons to find the right place, & I'd rather break it down into more piles.

Re: Ask HN: How have you applied computer science IRL?

#17
My friends and I figured out that the counter showing beer consumption at a restaurant with a beer tap on each table wouldn't increase if we poured an amount smaller than the smallest amount necessary to increment the counter. Many glasses of beer were had by pouring tiny amounts repeatedly.

Re: Ask HN: How have you applied computer science IRL?

#18
I'm a musician, and have a folder full of songs in my repertoire. I used to strictly alphabetize, but now I use dividers lettered A-Z (hash table), with each letter organized alpha at first, but move-to-front whenever I perform a song (MRU). I can now often find the song I want in 1 or 2 lookups, which really beats binary search.

Re: Ask HN: How have you applied computer science IRL?

#19

I don't know about you guys but when I go grab dinner with my philosophical-type friends, we all share a fork and knife.

That sounds like a problem where computer science techniques must be applied to solve. Lucily there aren't just forks.
Post reply on HN