Re:The Dollar Redesign Project
by abstractbill on Wednesday May 20, 2009 @02:26PM
(#619024)
I wish US bills were different sizes. If I have a wallet full of UK currency, finding the right note is O(1). If I have US currency, it's O(n).
[ Parent
| on HN ]
Re:The Dollar Redesign Project
by ComputerGuru on Wednesday May 20, 2009 @02:39PM
(#619053)
No it's not. Sort them upon entry into the wallet.
Re:The Dollar Redesign Project
by abstractbill on Wednesday May 20, 2009 @02:44PM
(#619067)
You just shifted the overhead from removal to insertion. Having different sized notes removes the overhead entirely.
I like your idea, but sorting on insertion is O(log(N)), which is faster than searching an unordered list and just as fast as having different-sized bills.
With different sized bills:
* Sorting is O(N) [see spaghetti sort: http://en.wikipedia.org/wiki/Spaghetti_sort]
* Retrieval is O(1).
Further, retrieval is O(1) even in unordered sets, so sorting is irrelevant.
(Also, how is sorting on insertion O(log(N))? For each new bill, finding the correct spot is log(N), so you're still looking at O(N log(N)).)
I only meant for inserting one bill, so N is the number of bills you have already. Using a binary search on a sorted list, either to find a specific denomination you want or to find the correct spot for a new bill, is O(log(N)).
Re:The Dollar Redesign Project
by run4yourlives on Wednesday May 20, 2009 @02:53PM
(#619090)
How many bills do you carry?
I live in Canada, the land of the debit card. It's rare for me to actually even carry cash anymore.
Also the fact that the smallest note in the UK (£5) is approx 10 times the value of the smallest note in the US ($1) helps enormously.
Seriously, what's the point of a $1 note? To irritate people everywhere trying to feed them into vending machines?