struct treeNode {
char *word;
struct treeNode *left;
struct treeNode *right;
struct treeNode *father;
};
struct treeNode* new_node;
new_node = (struct treeNode *) malloc(
sizeof(struct treeNode));
new_node->word= malloc(sizeof(char)*(k+1));
This is how i implement but i noticed that malloc is quite slow... Is there a way to use only one malloc to allocate space for both the node and the string?