#I'd write a STL version of the whole thing when needed for any practical use...I'm just trying to grope the basics through this..
*I am choosing Doubly linked lists because the matrix would frequently need to remove/add/interchange..etc ..rows & columns.
&& It will typically not go beyond 4*4 order...so access time will be well and good.. Any better Idea?
The barebone structure of the code would be like:->
Code:
class token;
class node
{
public:
token* pre;
token t;
token* pos; //post
//Some funcs to be added as required
};
class line //i.e a single row or column ....
{
public:
node* pre;
node n;
node* pos;
//same as above
};
class matrix
{
};
At this point, I can not imagine what I should put inside the matrix class...
if I put it in this way..
Code:
line* r_pre; // for rows
line r_l;
line* r_pos;
line* c_pre; // for columns
line c_l;
line* c_pos;
....I can't figure out how the constructor should behave...
Finally.. is there a better way to do the whole thing?