Hmm...
You want the best datastructure to represent an N dimensional object.
An (obvious) observation first:
The minimum number of unique points required to
describe a given dimensional object is:
0D = 1
1D = 2
2D = 3
3D = 4
: : :
ND = N-1 ((N-1)D objects)
So there are 2 variable sizes involved here,
N, which determines the size of each point,
and the number of dimensions obviously.
Also the above numbers are minimums, but
there is no max. Therefore the point (0D) type
would be a (malloced) array of N units and
everything else would be a linked list hierarchy
of depth N-1.
I.E.
1D = linked list of 0D obects
2D = linked list of 1D objects
: : :
Hmm I guess you could also represent 0D with
a linked list of N units for consistency?
Padraig.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!