G
Giles Bowkett
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.
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.