Page 571 - Computer science 868 Class 12
P. 571

52      if(p!=-1)
                   53      System.out.println("YES. THE POSITION IS "+(p+1));

                   54      else
                   55      System.out.println("NOT FOUND");
                   56          }

                   57      public static void main()

                   58          {
                   59      Bubble_Binary ob=new Bubble_Binary();
                   60      ob.accept();

                   61      ob.bubble();
                   62      ob.binary_search();

                   63          }
                   64      }



                 Output of the preceding program is as follows:
                 ENTER SIZE OF THE ARRAY

                 5
                 ENTER ARRAY ELEMENTS
                 654

                 6352

                 45
                 643
                 6

                 THE SORTED ARRAY IS:-
                 6

                 45
                 643

                 654
                 6352

                 ENTER NUMBER TO BE SEARCHED
                 654
                 YES. THE POSITION IS 4











                                                                                                                       569
                                                                                                   Internal Assessment  569
   566   567   568   569   570   571   572   573   574   575   576