int node_destroy_after(struct linked_list *list, int data) { struct linked_node *node = get_node(list, data); if (node == NULL || node->next == NULL) return -NDNULL; del_after(node); return 0; }
//Main Execution void main() { int a,i; clrscr(); while(1) { printf("\n1.insert_beg\n"); printf("2.insert_end\n"); printf("3.display\n"); printf("4.del_beg\n"); printf("5.del_end\n"); printf("6.del_after\n"); printf("7.insert_befroe\n"); printf("8.exit\n"); printf("\n"); printf("enter a choice:"); scanf("%d",&a); switch(a) { case 1:insert_beg(); break; case 2:insert_end(); break; case 3:display(); break; case 4:del_beg(); break; case 5:del_end(); break; case 6:del_after(); break; case 7:insert_before(); break; case 8: exit(1); default: printf("enter a valid choice"); } } }