start -prev new_nodenew_node -next startnew_node -prev nullstart new_nodereturn startstruct node *insert_end(struct node *startstruct node *ptr*new_nodeint numprintf("\ enter the data ")scanf("% "&num)new_node (struct node *)malloc(sizeof(struct node))new_node -data numptr=startwhile(ptr -next !nullptr ptr -nextptr -next new_nodenew_node -prev ptrnew_node -next nullreturn startstruct node *insert_before(struct node *startstruct node *new_node*ptrint numvalprintf("\ enter the data ")scanf("% "&num)printf("\ enter the value before which the data has to be inserted ")scanf("% "&val)new_node (struct node *)malloc(sizeof(struct node))new_node -data numptr startwhile(ptr -data !valptr ptr -nextnew_node -next ptrnew_node -prev ptr-prevptr -prev -next new_nodeptr -prev new_nodereturn startstruct node *insert_after(struct node *startstruct node *new_node*ptrint numvalprintf("\ enter the data ")scanf("% "&num)printf("\ enter the value after which the data has to be inserted ")scanf("% "&val)new_node (struct node *)malloc(sizeof(struct node))new_node -data numptr startwhile(ptr -data !valptr ptr -nextnew_node -prev ptrnew_node -next ptr -nextptr -next -prev new_nodeptr -next new_nodereturn start