namespace Multidimensional {
Template<class T> class List; // To allow pointers to lists
Template<class T> class List {
List<T> *Up;
List<T> *Down;
List<T> *Left;
List<T> *Right;
T Data;
public:
T Element(unsigned int x, unsigned int y) {
// To be defined later. I'm sleepy
}
void InsertElement(T data, unsigned int x, unsigned int Y) {
// To be defined later. It's six in the damn morning!
}
List() {
Up = NULL;
Down = NULL;
Left = NULL;
Right = NULL;
}
};
};
How would you make a multidimensional linked list /prog/?
struct Node {
void *this; // contents of the node
int dimensions; // number of dimensions
struct Node *nodes; // array of next nodes in all the dimensions
};
Note that the number of dimensions could even change from node to node, though I don't see anything useful in that.