Greedy (bigendian) algoritm To count out an integer number of dollars in US currency with as few bills as possible you use this scheme: Use as many of the largest bill as you can. Then move down a denomination and repeat until it's all counted.

We can use this scheme to convert a decimal representation of a number to binary. The "denominatons" are powers of 2.