Hello there..i'm trying to implement a tree in C#..the basic node structure is give below
struct node
{
public int _x;
public int _y;
public int _cost;
public node _parent;
public pos(int i, int j,int cost,pos parent)
{
_x = i;
_y = j;
_cost = cst;
_parent = parent;
}
}
I get the following error when i try to compile : 'node' causes a cycle in the struct layout
This was the way we used to make a tree in C++..but it's confusing in C#..could anyone please enlighten me?? Any help would be appreciated.