How to build tree

please tell me how to build tree in this question

use simple bst logic to insert

this is how functions looks like

	node* insertnode(int d, node*startnode) {
		if (startnode == NULL) {
			node*nn = new node(d);
			return nn;
		}

		if (startnode->data > d) {
			startnode->left = insertnode(d, startnode->left);
		}

		else {
			startnode->right = insertnode(d, startnode->right);
		}
		return startnode;
	}
	node* BuildTree(int *arr, int n) {
		for (int i = 0; i < n; i++) {
			rootnode = insertnode(arr[i], rootnode);
		}
        return rootnode;
	}

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved :grinning:
if you have more doubts regarding this feel free to ask