Page 389 - ComputerScience_Class_11
P. 389

4.  What do you need while inputting data in an array from the user?
                       a. File class                                   b.  ArrayList class
                       c.  Scanner class                               d.  String class
                    5.  Which of the following properties is used to find the length of an array?
                       a.  len                                         b.  length
                       c.  size                                        d.  getLength
                    6.  "It is used to determine whether an element is present in the array or not." What is the given statement referring to?
                       a.  Merging                                     b.  Insertion
                       c.  Searching                                   d.  Traversing
                    7.  Which type of searching technique requires the sorted data?
                       a.  Binary search                               b.  Linear search
                       c.  Jump Search                                 d.  Hash Search
                    8.  Which of the following is the fastest searching technique?
                       a.  Jump Search                                 b.  Exponential Search
                       c.  Binary Search                               d.  Sequential Search
                    9.  In which sorting technique, the smallest element is searched and interchanged with the first element?
                       a.  Bubble sort                                 b.  Selection sort
                       c.  Insertion sort                              d.   Quick Sort
                    10.  Which of the following arrays contains a combination of rows and columns?
                       a.  Single dimensional array                    b.  Double dimensional array
                       c.  Character array                             d.  Pointer array

                  Answers
                    1.  b      2.  a     3.  a     4.  c    5.  b     6.  c     7.  a     8.  c     9.  b     10.  b


                 B.  Fill in the blanks.
                    1.  ………………… technique compares the element with the next element and swaps if the given condition matches.
                    2.  ………………… contains multiple rows and multiple columns.
                    3.  Execution is ………………… in binary search with respect to linear search.
                    4.  Finding an element in the array is called ………………… .
                    5.  ………………… is a technique of adding an element to the array.
                    6.  ………………… is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half.
                    7.  In  …………………, the consecutive elements are checked from the beginning.
                    8.  An array is a ………………… data type.
                    9.  ………………… element is represented by a[5].
                    10.  ………………… is the process of combining two or more arrays.


                  Answers
                    1.   Bubble sort     2.   Double-dimensional array 3.  faster   4.  Searching      5.   Insertion
                    6.   Binary search   7.   Linear search    8.  Composite      9.  Sixth           10.   Merging


                 C.  Answer the following questions:
                    1.  What is an array?
                   Ans.  Arrays can be defined as a set of variables that contains values of the same data types having the same variable name but
                       different subscripts required to separate the values. Thus, an array is a composite data type.
                    2.  How do you declare an array in Java?
                   Ans.  In Java, an array is declared using the syntax:
                       dataType[] arrayName = new dataType[size];.
                    3.  How can you access an element of an array in Java?
                   Ans.  An element of an array can be accessed using the index. For example, arr[0] will access the first element.



                                                                                                           Arrays  387
   384   385   386   387   388   389   390   391   392   393   394