From: Giles Bowkett Date: 2006-11-06T11:03:26+09:00 Subject: Re: array sorting question ok, cancel that, this is not the tower of hanoi, this is splitting an array in half, sorting both halves, and reversing one before putting it back together. doh!! On 11/5/06, Giles Bowkett wrote: > I have an array of arrays. the interior arrays can be of any arbitrary > length including zero. I want to sort the array of arrays in such a > way that the interior arrays with the most elements are closest to the > middle of the main array. > > so if it comes out like this: > main[0] = [1, 2, 3, 4, 5] > main[1] = [] > main [2] = [] > main [3] = [1, 2] > > then that's wrong. but it's good if it looks like this: > > main[0] = [] > main[1] = [1, 2] > main[2] = [1, 2, 3, 4, 5] > main[3] = [] > > and of course it should scale with more data to produce pyramids. > > wait a minute. is this the Tower of Hanoi? > > any and all suggestions welcome. I'm going to look up the Tower of > Hanoi. I think that's what it is. > > -- > Giles Bowkett > http://www.gilesgoatboy.org > > -- Giles Bowkett http://www.gilesgoatboy.org