S
SAUHING LEE
I am getting some troubles for creating multiple tree after calling
self defined struct variable.
the struct is the following:
typedef struct tree {
struct tr_n_t *left;
struct tr_n_t *right;
int weight;
int key;
} node;
tree_node_t *tree;
tree = create_tree();
I call tree = create_tree(); when create a new tree.
Let say i want want to create a new struct call "multiple_tree" and
then create multiple trees according to its parameter. For example:
multiple_tree *mt;
mt= create_tree(5)
The function creates 5 trees and assigns all 5 trees to variable mt.
Question: How can i store arbitrary amount of tree in a variable?
How can i access the tree stored in the variable?
self defined struct variable.
the struct is the following:
typedef struct tree {
struct tr_n_t *left;
struct tr_n_t *right;
int weight;
int key;
} node;
tree_node_t *tree;
tree = create_tree();
I call tree = create_tree(); when create a new tree.
Let say i want want to create a new struct call "multiple_tree" and
then create multiple trees according to its parameter. For example:
multiple_tree *mt;
mt= create_tree(5)
The function creates 5 trees and assigns all 5 trees to variable mt.
Question: How can i store arbitrary amount of tree in a variable?
How can i access the tree stored in the variable?