Struggling hard to understand the function: node* k_smallest_elementUtil(node* tree, int k, int &count). Any help will be appreciated. Thanks.

```
#include<iostream>
using namespace std;
struct node{
int data;
node *left;
node *right;
```

};

```
node *newnode(int data){
node *new_node=new node;
new_node->data=data;
new_node->left=NULL;
new_node->right=NULL;
return new_node;
```

}

```
node *insert(node *tree, int data){
if(tree==NULL) return newnode(data);
if(data<tree->data){
tree->left=insert(tree->left,data);
}
else{
tree->right=insert(tree->right,data);
}
return tree;
```

}

```
node* k_smallest_elementUtil(node* tree, int k, int &count){
if(tree==NULL) return tree;
node *left=k_smallest_elementUtil(tree->left,k,count);
if(left) return left;
count++;
if(count==k) return tree;
node* right=k_smallest_elementUtil(tree->right,k,count);
if(right) return right;
return NULL;
```

}

```
node* k_smallest_element(node* tree, int k){
int count=0;
return k_smallest_elementUtil(tree,k,count);
```

}

```
int main(){
int k=5;
node *tree=NULL;
tree=insert(tree,20);
insert(tree,8);
insert(tree,22);
insert(tree,4);
insert(tree,12);
insert(tree,10);
insert(tree,14);
node *temp=k_smallest_element(tree,5);
```