void main() { clrscr(); do { printf("\n1-->insert\n"); printf("2-->delete\n"); printf("3-->display\n"); printf("4-->exit\n"); printf("enter your choice\n"); scanf("%d",&choice); switch(choice) { case 1:qinsert(); break; case 2:qdelete(); break; case 3:qdisplay(); break; case 4:return; } } while(choice!=4); }
int main() { struct node *front, *rear; front=rear=NULL; addatend(&front, &rear, 10); //10 qdisplay(front); addatbeg(&front, &rear, 20); //20 10 qdisplay(front); addatbeg(&front, &rear, 30); //30 20 10 qdisplay(front); addatend(&front, &rear, 5); //30 20 10 5 qdisplay(front); delbeg(&front, &rear); //20 10 5 qdisplay(front); delend(&front, &rear); //20 10 qdisplay(front); getch(); }