data structures using ptr -right_child insert(infoptr -right_childht_inc)if(*ht_inc==trueswitch(ptr -balancecase /left heavy *ptr -balance *ht_inc falsebreakcase /balanced *ptr -balance - breakcase - /right heavy *aptr ptr -right_childif(aptr -balance =- printf("right to right rotation\ ")ptr -right_childaptr -left_childaptr -left_child ptrptr -balance aptr -balance= ptr aptrelse printf("right to left rotation\ ")bptr aptr -left_childaptr -left_child bptr -right_childbptr -right_child aptrptr -right_child bptr -left_childbptr -left_child pptrif(bptr -balance =- ptr -balance else ptr -balance if(bptr -balance = aptr -balance - else aptr -balance bptr -balance= ptr bptr}/*end of else**ht_inc falsereturn(ptr)void display(struct node *ptrint levelint iif ptr!=null display(ptr -right_childlevel+ )printf("\ ")for ( leveli++printf(")printf("% "ptr -val)display(ptr -left_childlevel+ )