programming example write program to implement simple right in-threaded binary trees #include #include struct tree int valstruct tree *rightstruct tree *leftint thread}struct tree *root nullstruct treeinsert_node(struct tree *rootstruct tree *ptrstruct tree *rtif(root =nullroot ptrif(rt !nullroot->right rtroot->thread else if(ptr->val valroot->left insert_node(root->leftptrroot)else if(root->thread = root->right insert_node(nullptrrt)root->thread= else root->right insert_node(root->rightptrrt)return rootstruct treecreate_threaded_tree(struct tree *ptrint numprintf("\ enter the elementspress - to terminate ")scanf("% "&num)while(num !- ptr (struct tree*)malloc(sizeof(struct tree))ptr->val numptr->left ptr->right nullptr->thread root insert_node(rootptrnull)printf(\ enter the next element ")fflush(stdin)scanf("% "&num)return rootvoid inorder(struct tree *rootstruct tree *ptr root*prevdo while(ptr !nullprev ptrptr ptr->left