Page 152 - DCAP407_DATA_STRUCTURE
P. 152

Unit 8:  Queues



                                    case 2:
                                       del();
                                       break;
                                    case 3:
                                       disp();
                                       break;
                                    default: exit(1);
                                    }
                                  }
                               }
                               Output:
                               1.  INSERT
                               2.  DELETE
                               3.  DISPLAY

                               4.  EXIT
                               Enter your choice:
                               1
                               Enter the element to be inserted
                               10
                               Enter a priority
                               1
                               1.  INSERT

                               2.  DELETE
                               3.  DISPLAY
                               4.  EXIT
                               Enter your choice:
                               1
                               Enter the element to be inserted

                               20
                               Enter a priority
                               2
                               1.  INSERT
                               2.  DELETE
                               3.  DISPLAY
                               4.  EXIT
                               Enter your choice:

                               3
                               QUEUE IS:
                               10[PRI=1]
                               20[PRI=2]
                               1.  INSERT




                                        LOVELY PROFESSIONAL UNIVERSITY                          145
   147   148   149   150   151   152   153   154   155   156   157