I’m trying to make a tree with more than 2 branches by node. Here is my code :
typedef struct node{
int value;
struct node children[];
} node_t;
Here is an example for a 4-branches tree:
`
0
/ | |
1 2 3 4
I guess it is not the right way to do that but I’m beginning in C.
I tried a version with a chained list but it was not better.
New contributor
Le cocotier is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1