I am implementing BST and need suggestion from you. The code has 2 structures. I need to allocate link structure within item structure. how would I do that? Do I need to allocate both item->link->left & item->link->right
?
Please explain by example?
struct link;
struct link
{
struct link *left;
struct link *right;
};
struct item
{
struct link link;
uint8_t c;
};
In somewhere insert function
item *temp = NULL;
// How would I allocate memory ??