English

Rupa Pandit solutions for Computer Applications [English] Class 10 ICSE chapter 7B - Arrays - Sort & Search [Latest edition]

Advertisements

Chapters

Rupa Pandit solutions for Computer Applications [English] Class 10 ICSE chapter 7B - Arrays - Sort & Search - Shaalaa.com
Advertisements

Solutions for Chapter 7B: Arrays - Sort & Search

Below listed, you can find solutions for Chapter 7B of CISCE Rupa Pandit for Computer Applications [English] Class 10 ICSE.


Exercises
Exercises [Pages 196 - 200]

Rupa Pandit solutions for Computer Applications [English] Class 10 ICSE 7B Arrays - Sort & Search Exercises [Pages 196 - 200]

Choose the correct answer.

1. (i)Page 196

A pre-sorted array is necessary for:

  • Linear Search

  • Binary Search

  • Bubble Sort

1. (ii)Page 196

Which statement is false?

  • Bubble sort needs a nested loop.

  • Selection sort needs a nested loop.

  • Linear search needs a nested loop.

1. (iii)Page 196

Which statement is true?

  • Bubble sort can arrange an array in only ascending order.

  • Binary search can work on any array.

  • Linear search does not need the array to be arranged in any order.

1. (iv)Page 197

Binary search looks for the element to search in position:

  • First

  • Middle

  • Last

  • Any random

2. (i)Page 197

Write an algorithm for the binary search method. Explain algorithm with a suitable example.

2. (ii)Page 197

write difference between Linear Search and Binary Search.

2. (iii)Page 197

Define the procedure of bubble sort with an example.

2. (iv)Page 197

What is linear search?

3. (i)Page 197

The following code may contain some errors. Identify the errors, modify the program by underlining the changes made, and write the aim of the program.

import java.io.*;
import java.util.Scanner; 
class clPaperA
{
    void fnLinkA()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print(" Enter the number of elements :");
        int n = sc.nextInt();
        int LA[ ] = new int [n];        
        for(start = 0; start < n; start++)
        {
            max = LA[start];
            position = start;
            for(range = start + 1; range < n; range++)
            {
                if(max > LA[range])
                {
                    max = LA[range];
                    position = range;
               {
            }
        }            
        tmp = LA[start]; //swapping
        LA[start] = LA[position];
        LA[position] = tmp;
        System.out.println(" The elements in Ascending Order ...");
        for(r = 0; r < n; r++)
        {
            System.out.print(LA[r] + " ");
        }
    }
}
3. (ii)Page 198

The following code may contain some errors. Identify the errors, modify the program by underlining the changes made, and write the aim of the program.

import java.io.*;
class clPaperB
{
    int TY[];
    clPaperB(int n)
    {
       TY = new int [n];
    {
    void fnInputB()
    {
      Scanner sc = new Scanner(System.in);
      int s = TY.length;
      for(int j = 0; j <= s − 1; j++)
      {
          System.out.print("Enter value for cell num " + j +" : ");
          TY[j] = sc.nextInt();
      }
    }
    void fnWorkB()
    {
      for(int p = 0; p<=s; p++)
      {
       for(int q = 0; q<=sp; p++)
       {
           if(TY[q+1]> TY[q])
           {
              tmp = TY[p];
              TY[p] = TY[p +1];
              TY[p + 1] = tmp;
            }
        }
      }
    }
    void fnShow()
    {
       System.out.println(" The elements in Descending Order ...")
       for(int j = 0; j<=s - 1; j++)
       System.out.print(" TY[j] ");
    }
}
3. (iii)Page 199

The following code may contain some errors. Identify the errors, modify the program by underlining the changes made, and write the aim of the program.

int RA[ ] = {42, 51, 75, 95, 86, 84, 62};
boolean fnLinearSearch(int val)
{
    for(int p = RA.length;p >=0; p--)
    {
        if(RA[p] = val)
        {
           break;
        }
    }
    if(p >= 0)
    return true;
    return false;
}
3. (iv)Page 199

The following code may contain some errors. Identify the errors, modify the program by underlining the changes made, and write the aim of the program.

int SA[ ] = {79, 58, 42, 61, 79, 66, 34, 62, 94, 73};
int n = SA.length;
void fnBinarySearch(int val)
{
    while(min <= max)
    {
       mid = low + high/2;
       System.out.print("\n Element at mid " + mid + "“ IS " + SA[mid]);
       if(SA[mid]=val)
       {
          found = true;
          break;
       }
       else if(SA [mid] < val)
       {       
          high = mid -1;
       }
       else 
       {
          low = mid + 1;
       }
    }
    if(found=true)
       System.out.print("\n Element" + val + “ IS Present.");
    else
       System.out.print("\n Element " + val + " IS NOT Present.");
} //closing binary search
4. (i)Page 200

Write a program for the following.

Create a string array ST[ ] to assign the following color names. Arrange the names in ascending order using Bubble Sort -Violet, Indigo, Blue, Green, Yellow, Orange, Red.

[Hint: (StringArray[p].compareTo(StringArray[p + 1]) > 0)indicates a swap is needed]

4. (ii)Page 200

Write a program for the following.

Create a String array SB[ ] to assign the following subject names. Arrange the names in descending order using Selection Sort:

Hindi, English, Mathematics, History, Civics, Geography, Science, Music, Art, Fitness.

4. (iii)Page 200

Write a program for the following.

Create a String array SP[ ] of size 10. Input names of Indian Heritage Sites. Arrange the names in ascending order of their string-length.

4. (iv)Page 200

Write a program for the following.

Create a String array WR[ ] and an integer array WL[], both of size 10. Input/Store names of World Rivers. Arrange the River Names in ascending order of their lengths.

4. (v)Page 200

Write a program for the following.

Create a String array FC[ ] and a numeric array FP[ ] of size 10, to store the names of 10 Food Crops and their annual production in corresponding cells. Sort the arrays in ascending order of their annual production. [Apply Selection Sort].[Suggestion : Take data from Geography Textbook].

Solutions for 7B: Arrays - Sort & Search

Exercises
Rupa Pandit solutions for Computer Applications [English] Class 10 ICSE chapter 7B - Arrays - Sort & Search - Shaalaa.com

Rupa Pandit solutions for Computer Applications [English] Class 10 ICSE chapter 7B - Arrays - Sort & Search

Shaalaa.com has the CISCE Mathematics Computer Applications [English] Class 10 ICSE CISCE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. Rupa Pandit solutions for Mathematics Computer Applications [English] Class 10 ICSE CISCE 7B (Arrays - Sort & Search) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. Rupa Pandit textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in Computer Applications [English] Class 10 ICSE chapter 7B Arrays - Sort & Search are .

Using Rupa Pandit Computer Applications [English] Class 10 ICSE solutions Arrays - Sort & Search exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in Rupa Pandit Solutions are essential questions that can be asked in the final exam. Maximum CISCE Computer Applications [English] Class 10 ICSE students prefer Rupa Pandit Textbook Solutions to score more in exams.

Get the free view of Chapter 7B, Arrays - Sort & Search Computer Applications [English] Class 10 ICSE additional questions for Mathematics Computer Applications [English] Class 10 ICSE CISCE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×