Re: Sorting dominoes

2005-11-13 Thread Yu-Xi Lim
DaveM wrote: > Essentially, I'm trying to sort 12 dominoes. Each domino has two different > numbers and there are two of every number. Identical dominoes are possible, > but doubles are not. > > The problem is to place the dominoes in a line, side to side, so that two > columns (or rows, depending

Re: Sorting dominoes

2005-11-13 Thread jepler
So if you have the dominoes (1 2), (3 2) and (3 1) you must arrange them as 1|2|3 2|3|1 ? If so, then it seems to me your algorithm is this: 1. pick an arbitrary domino to be first, and an arbitrary side to be the "top" 2a. until the dominoes are exhausted, pick the other domino wi