Page 516 - Computer science 868 Class 12
P. 516

6         { size=max;
                 7           Q=new String[size];

                 8           start=end=0;
                 9         }

                10       void pushAdd(String n)
                11       {

                12       if(end<size) // inserting data
                13       { Q[end]=n;
                14         ++end;}

                15       else // overflow case

                16       System.out.println("NO SPACE");
                17       }
                18       String popadd() {

                19       if(start <end ) // removing from front
                20       { start++;

                21         return Q[start];
                22       }

                23       else
                24       return "?????";

                25       }
                26       void show()

                27       { for(int i==start+1;i<=end;i++) // displaying queue content
                28         { System.out.print(Q[i]+" ");}

                29       }
                30        public static void main(int s)

                31       {    Diary ob=new Diary(s);
                32            Scanner sc= new Scanner(System.in);

                33            int ch;
                34            String n;

                35            do    //menu
                36            { System.out.println("1.Insert  \n 2.Delete \n 3.Display \n enter choice");

                37              ch=sc.nextInt();
                38              switch(ch)
                39              {case 1:





                514514  Touchpad Computer Science-XII
   511   512   513   514   515   516   517   518   519   520   521