News for hackers. Stuff that matters.
Re:Who Wants to Be a Thousandaire? (2011) by taneq on Wednesday May 08, 2024 @09:56AM (#40298178)
Maybe less lucrative but when we had some new bookshelves installed and moved all our books onto them I used mergesort to get them in order. ;)
Re:Who Wants to Be a Thousandaire? (2011) by hennell on Wednesday May 08, 2024 @11:21AM (#40299106)
I've often pondered the optimal book organisation, sorting and inserting system. Organising by subject seems a good start, but then you have size to conser. Then you also tend to arrange by space - i.e. you might put two subjects together based more on similar size or shelf capacity then logical subject grouping.

For inserts a reverse-sorted inserting-from-the-back makes most sense to reduce moving of books, but I suspect there's probably an optimal 'free space' value to allow for easier inserting.

Re:Who Wants to Be a Thousandaire? (2011) by lostlogin on Wednesday May 08, 2024 @02:20PM (#40301335)
> I've often pondered the optimal book organisation

Let me introduce you to an option I recently found. I went to get a book from our (large) bookcase and found they’d all been reorganised based on cover colour.

Re:Who Wants to Be a Thousandaire? (2011) by kragen on Wednesday May 08, 2024 @03:41PM (#40302078)
that's grounds for divorce
Re:Who Wants to Be a Thousandaire? (2011) by gravescale on Thursday May 09, 2024 @05:58AM (#40306670)
Makes it much easier to buy new books that way: https://www.ebay.com/sch/i.html?_nkw=red+books+by+foot
Re:Who Wants to Be a Thousandaire? (2011) by marcosdumay on Wednesday May 08, 2024 @10:07AM (#40298285)
Bucket-(insert-)sort is also an all time favorite. I've taught it to many people already.

It helps that it works in a very intuitive way.

Re:Who Wants to Be a Thousandaire? (2011) by noman-land on Wednesday May 08, 2024 @10:38AM (#40298613)
Teach it to us! I'm not familiar with this.
Re:Who Wants to Be a Thousandaire? (2011) by jasonjmcghee on Wednesday May 08, 2024 @12:11PM (#40299726)
It's bucket sort, and parent is suggesting insertion sort within each bucket as the pre-merge step.

Say you're sorting alphabetically by title. You make one bucket per letter- put books into their respective bucket based on first letter of title. Then sort using insertion sort within each bucket. Then you're done.

(insertion sort is the human natural one- look for where the next one goes based on what you have so far and insert)

Same works for other heuristics.