```
#include <stdio.h>
#include <stdlib.h>
typedef struct node_st {
    int data;
    struct node_st* left;
    struct node_st* right;
};

void preorder(struct node_st *root) {
    if (root != NULL) {
        printf("%d\n", root->data);
        preorder(root->left);
        preorder(root->right);
    }
}

void postorder(struct node_st *root) {
    if (root != NULL) {
        postorder(root->left);
        postorder(root->right);
        printf("%d\n", root->data);
    }
}

struct node_st* createNode(value) {
    struct node_st* newNode = malloc(sizeof(struct node_st));
    newNode->data = value;
    newNode->left = NULL;
    newNode->right = NULL;

    return newNode;
}

struct node_st* insertLeft(struct node_st* root, int value){
    root->left = createNode(value);
    return root->left;
}

struct node_st* insertRight(struct node_st* root, int value){
    root->right = createNode(value);
    return root->right;
}

int main() {
    struct node_st* root = createNode(2);
    insertLeft(root, 6);
    insertRight(root, 9);
    insertLeft(root->left, 2);
    insertLeft(root->right, 1);

    printf("\nPreorder\n");
    preorder(root);
    printf("\nPostorder\n");
    postorder(root);
}

```

I need to make a function to store a tree into a string with bracket representation like (A(B)(C)) and to read it to make a tree, but I'm having trouble finding info online on how to do this in C, would appreciate any help.

The next step after this is to store it and read it from a file, but I can handle that with the documentation.