Arrays ICSE Class 10 Computer Applications: Sorting and Searching
Updated 14 October 2026 · Fact-checked
An array is a group of variables of the same type sharing one name, with elements reached by an index starting at 0. ICSE Class 10 covers single and double dimensional arrays (declaring, initialising, input, access, length), selection and bubble sort, linear and binary search on 1D arrays, and row, column and diagonal sums of a 2D array.
What Arrays is about
Arrays supply the largest share of Section B programs: a 4 × 4 DIAGONAL check and a selection sort of pin codes in 2024; a 4 × 4 NORM and a binary search on a char array in 2025. Section A adds bytes used by arrays, index of an element in a 2D array, ar.length - 1 as the last index, and outputs from array expressions.
The syllabus asks for the definition and types of arrays; declaration, initialisation, input and access for single and double dimensional arrays; the length property; selection sort and bubble sort; linear search and binary search (sorting and searching on single dimensional arrays only); and for 2D arrays, sums of rows, columns and the left and right diagonals, and display in matrix format. Examiners regularly deduct for using the wrong sort or search, wrong loop bounds (1 to 4 instead of 0 to 3), wrong swaps and missing messages.
Weightage: CISCE publishes no chapter weightage. Section A (40 marks) is compulsory: 1-mark MCQs and 2-mark short answers including output and error questions; in Section B you answer any four of six 15-mark programming questions written in Java.Source: CISCE ICSE Computer Applications (661) specimen paper structure for 2027
Key concepts
- Single dimensional arrays
An array is a collection of variables of the same data type stored under one name in consecutive memory locations; each element is reached by an index (subscript) from 0 to length − 1. It is a composite (non-primitive) type.
Declaration and creation: int a[] = new int[5]; (5 ints, all 0). Or int[] a = new int[5];
Initialisation: int a[] = {4, 9, 2, 7, 9, 1}; String s[] = {"Blue", "Red"};
Access: a[0] is 4; a[a.length - 1] is the last element.
length: a.length gives the number of elements (no brackets; for a String it is s.length() with brackets).Input with a loop:
for (int i = 0; i < a.length; i++)
a[i] = sc.nextInt();Memory: elements × size of type: double d[] = new double[4] uses 4 × 8 = 32 bytes.
Using an index outside 0 to length − 1 (a[6] for a 6-element array) causes a runtime error (ArrayIndexOutOfBoundsException).
Worked example
(2 marks) int a[] = {4, 9, 2, 7, 9, 1}; (a) What is a[1] + a[4]? (b) What is the index of the smallest element?
Try it first, then show the solutionSolution
- a[1] = 9 and a[4] = 9; sum 18 - 1 mark.
- Smallest element 1 is at index 5 - 1 mark.
Answer: (a) 18 (b) 5
- Selection sort
Selection sort: in each pass, find the smallest element in the unsorted part and swap it with the first element of that part. After pass i, the first i + 1 elements are in their final places.
for (int i = 0; i < n - 1; i++)
{
int min = i;
for (int j = i + 1; j < n; j++)
if (a[j] < a[min])
min = j;
int t = a[i];
a[i] = a[min];
a[min] = t;
}Trace for {64, 25, 12, 22, 11}:
Pass 1: smallest 11 (index 4) swapped with 64 → 11 25 12 22 64
Pass 2: smallest of 25 12 22 64 is 12 → 11 12 25 22 64
Pass 3: smallest of 25 22 64 is 22 → 11 12 22 25 64
Pass 4: smallest of 25 64 is 25 (no change) → 11 12 22 25 64For descending order, look for the largest (a[j] > a[max]).
Worked example
(2 marks) Show the array {9, 4, 7, 1} after the first two passes of selection sort (ascending).
Try it first, then show the solutionSolution
- Pass 1: smallest 1 swapped with 9 → 1 4 7 9 - 1 mark.
- Pass 2: smallest of 4 7 9 is 4, already first → 1 4 7 9 - 1 mark.
Answer: After pass 1: 1 4 7 9; after pass 2: 1 4 7 9.
- Bubble sort
Bubble sort: compare each pair of adjacent elements and swap them if they are in the wrong order; after each pass the largest remaining element 'bubbles' to the end.
for (int i = 0; i < n - 1; i++)
for (int j = 0; j < n - 1 - i; j++)
if (a[j] > a[j + 1])
{
int t = a[j];
a[j] = a[j + 1];
a[j + 1] = t;
}Trace for {5, 1, 4, 2, 8}:
Pass 1: (5,1) swap → 1 5 4 2 8; (5,4) swap → 1 4 5 2 8; (5,2) swap → 1 4 2 5 8; (5,8) no swap.
Pass 2: (1,4) no; (4,2) swap → 1 2 4 5 8; (4,5) no.
Pass 3 and 4: no swaps. Result: 1 2 4 5 8.Selection vs bubble: selection makes at most one swap per pass after finding the minimum; bubble compares and swaps adjacent pairs, possibly many times per pass.
Worked example
(2 marks) Show the array {6, 3, 8, 2} after the first pass of bubble sort (ascending).
Try it first, then show the solutionSolution
- (6,3) swap → 3 6 8 2; (6,8) no swap - 1 mark.
- (8,2) swap → 3 6 2 8 - 1 mark.
Answer: 3 6 2 8
- Linear and binary search
Linear search: compare the key with each element from the first to the last until it is found or the array ends. Works on unsorted arrays; slow for large arrays.
int pos = -1;
for (int i = 0; i < n; i++)
if (a[i] == key) { pos = i; break; }Binary search: works only on a sorted array. Compare the key with the middle element; if equal, found; if the key is smaller, search the left half; if larger, the right half; repeat until found or the half becomes empty.
int low = 0, high = n - 1, pos = -1;
while (low <= high)
{
int mid = (low + high) / 2;
if (a[mid] == key) { pos = mid; break; }
else if (key < a[mid]) high = mid - 1;
else low = mid + 1;
}Trace in {3, 8, 15, 21, 34, 47, 52, 66} for key 47: low 0, high 7, mid 3 (21 < 47) → low 4; mid 5 (47) → found at index 5.
For key 10: mid 3 (21 > 10) → high 2; mid 1 (8 < 10) → low 2; mid 2 (15 > 10) → high 1; low > high → not found.For char arrays compare with == and <, as for numbers (not equals()).
Worked example
(2 marks) State two differences between linear and binary search.
Try it first, then show the solutionSolution
- Linear works on unsorted arrays; binary needs a sorted array - 1 mark.
- Linear checks elements one by one; binary halves the search range each step, so it is faster for large arrays - 1 mark.
Answer: (1) Linear search works on any array, while binary search works only on a sorted array. (2) Linear search checks elements one by one from the start, while binary search compares with the middle element and halves the range each time, so it is much faster for large arrays.
- Double dimensional arrays
A 2D array stores data in rows and columns: int m[][] = new int[3][4]; (3 rows, 4 columns, 12 elements). m[i][j] is the element in row i, column j (both from 0). m.length is the number of rows; m[0].length the number of columns.
Initialisation: int x[][] = {{2, 4}, {6, 8}, {10, 12}}; (3 × 2; x[2][1] = 12).
Input with nested loops:
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
m[i][j] = sc.nextInt();Display in matrix form:
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
System.out.print(m[i][j] + "\t");
System.out.println();
}Sums for an n × n matrix:
Row i: add m[i][j] for all j. Column j: add m[i][j] for all i.
Left (main) diagonal: elements where i == j: m[0][0], m[1][1], ...
Right diagonal: elements where i + j == n − 1: m[0][n−1], m[1][n−2], ...Memory: a char array of 4 rows and 3 columns has 12 elements × 2 bytes = 24 bytes.
Worked example
(2 marks) int x[][] = {{2, 4}, {6, 8}, {10, 12}}; What is x[0][1] + x[2][1]? What is the order of x?
Try it first, then show the solutionSolution
- x[0][1] = 4; x[2][1] = 12; sum 16 - 1 mark.
- 3 rows and 2 columns: order 3 × 2 - 1 mark.
Answer: 16; the order is 3 × 2.
Arrays in real life
Each concept, met in an everyday situation. Read the situation, answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.
Binary search
Suppose you look up the word 'monsoon' in a printed dictionary by opening it near the middle, seeing 'lion', and then searching only the second half.
Which search technique is this, and why can't it be used on a jumbled list?
Try it first, then show the solutionSolution
- Opening at the middle and discarding half is binary search.
- It works because the dictionary is sorted alphabetically.
- In a jumbled list, the middle word tells you nothing about which half to discard.
Answer: Binary search; it needs the data to be sorted, so a jumbled list needs linear search.
Memory hook: Halve the book, halve the work: only if sorted.
2D array
Imagine a class register with 30 students (rows) and marks in 5 subjects (columns).
How would you store it and find one student's total and one subject's class total?
Try it first, then show the solutionSolution
- int marks[][] = new int[30][5];
- Student i's total: sum of row i over j = 0 to 4.
- Subject j's total: sum of column j over i = 0 to 29.
Answer: A 30 × 5 array; a student's total is a row sum and a subject's total is a column sum.
Memory hook: Rows are people, columns are subjects.
Selection sort
Suppose a PE teacher lines students up by height by repeatedly finding the shortest remaining student and placing them next in line.
Which sort is this?
Try it first, then show the solutionSolution
- Each round selects the smallest from the unsorted group.
- It is placed at the next position.
- That is selection sort.
Answer: Selection sort: repeatedly select the minimum and put it in place.
Memory hook: Select the smallest, place it, repeat.
Topics in this chapter
Arrays: syntax and key facts
- Index range
- 0 to a.length − 1; last element a[a.length - 1]
- length (array) has no brackets; length() is for String.
- Memory
- bytes = elements × size of type; 2D elements = rows × columns
- int 4, double 8, char 2.
- Binary search mid
- 1.mid = (low + high) / 2; key < a[mid]
- 2.high = mid − 1; key > a[mid]
- 3.low = mid + 1
- Loop while low <= high.
- Diagonals (n × n)
- Left: i == j; Right: i + j == n − 1
- For 4 × 4: right diagonal m[0][3], m[1][2], m[2][1], m[3][0].
- Sort passes
Both sorts n − 1 passes Bubble inner loop j < n − 1 − i Selection inner loop j from i + 1
How the board asks Arrays
The question patterns to expect, and the method that works for each.
| Question type | How it is asked | Method |
|---|---|---|
| MCQ (Section A) | Bytes for a 4 × 3 char array (2024) and a double array (2025); index of an element in a 2D array (2025); last index ar.length - 1 (2025); length of an array element (2024). | Count elements × size; indexes from 0; length vs length(). |
| Short answer (2 marks) | Order and element access in a 2D array (2024); initialise a 3 × 2 array (2025); outputs like a[0] + a[5] (2025). | Write the array with indexes above each element before answering. |
| Program (15 marks) | DIAGONAL array check (2024), selection sort (2024), NORM of a 4 × 4 array (2025), binary search in a char array (2025). | Use exactly the technique asked; loops 0 to n − 1; initialise sums to 0; print both success and failure messages. |
Tricks to remember Arrays
Short memory aids. Say each one aloud once, then use it on a question the same day.
Select the min, bubble the max
Selection sort puts the minimum at the front each pass; bubble sort pushes the maximum to the end.
Use it when: Telling the sorts apart.
Binary needs order
Binary search only on a sorted array; otherwise go linear.
Use it when: Search questions.
Right diagonal adds to n − 1
On the right diagonal, row + column = n − 1.
Use it when: Diagonal sums.
Arrays: board-level solved questions
Ordered from board level to HOTS. Cover the solution, write your own, then compare step by step.
Example 1: Last index · 1 mark · MCQBoard level
The index of the last element of an array ar[] is:
(a) ar.length()
(b) ar[].length
(c) ar.length() - 1
(d) ar.length - 1
Try it first, then show the solutionSolution
- Arrays use the length property (no brackets); indexes end at length − 1.
Answer: (d) ar.length - 1
Example 2: 2D index · 1 mark · MCQBoard level
A 2D array D[2][3] holds: row 0 - Pen, Pencil, Eraser; row 1 - Ruler, Compass, Sharpener. The index of Compass is:
(a) D[1][1]
(b) D[0][1]
(c) D[1][2]
(d) D[2][2]
Try it first, then show the solutionSolution
- Row 1 (second row), column 1 (second item).
Answer: (a) D[1][1]
Example 3: Binary search trace · 2 marks · Short answerHarder board level
Trace binary search for key 10 in {3, 8, 15, 21, 34, 47, 52, 66}. How many comparisons with a[mid] are made, and what is the result?
Try it first, then show the solutionSolution
- low 0, high 7, mid 3: 21 > 10 → high 2; mid 1: 8 < 10 → low 2; mid 2: 15 > 10 → high 1.
- low 2 > high 1: stop. 3 comparisons; not found.
Answer: 3 comparisons (with 21, 8 and 15); the key is not found.
Example 4: Bubble sort pass count · 2 marks · Short answerHarder board level
Show the array {7, 3, 9, 1} after each pass of bubble sort in ascending order.
Try it first, then show the solutionSolution
- Pass 1: (7,3) swap → 3 7 9 1; (7,9) no; (9,1) swap → 3 7 1 9.
- Pass 2: (3,7) no; (7,1) swap → 3 1 7 9. Pass 3: (3,1) swap → 1 3 7 9.
Answer: Pass 1: 3 7 1 9; Pass 2: 3 1 7 9; Pass 3: 1 3 7 9
Example 5: Selection sort program (Section B) · 15 marks · Long answerHarder board level
Write a program to store the heights (in cm) 152, 138, 165, 141, 159, 147 in an array and sort them in descending order using selection sort only. Display the sorted array.
Try it first, then show the solutionSolution
- class SortHeights
{
public static void main(String args[])
{
int h[] = {152, 138, 165, 141, 159, 147};
int n = h.length; - for (int i = 0; i < n - 1; i++)
{
int max = i;
for (int j = i + 1; j < n; j++)
if (h[j] > h[max])
max = j;
int t = h[i];
h[i] = h[max];
h[max] = t;
} - for (int i = 0; i < n; i++)
System.out.print(h[i] + " ");
}
} - Pass 1: max 165 → 165 138 152 141 159 147. Pass 2: max of rest 159 → 165 159 152 141 138 147. Pass 3: 152 stays → same. Pass 4: max of 141 138 147 is 147 → 165 159 152 147 138 141. Pass 5: max of 138 141 is 141 → 165 159 152 147 141 138.
- Descending order: look for the maximum each pass; the swap uses a temporary variable.
Answer: Output: 165 159 152 147 141 138
Example 6: Binary search on characters · 15 marks · Long answerHOTS / competency
Write a program to initialise the sorted char array {'B', 'D', 'G', 'K', 'M', 'R', 'T', 'X'} and search for a character entered by the user using binary search. Print 'Found at index ...' or 'Not found'.
Try it first, then show the solutionSolution
- import java.util.Scanner;
class CharSearch
{
public static void main(String args[])
{
char a[] = {'B', 'D', 'G', 'K', 'M', 'R', 'T', 'X'};
Scanner sc = new Scanner(System.in);
System.out.print("Character: ");
char key = sc.next().charAt(0); - int low = 0, high = a.length - 1, pos = -1;
while (low <= high)
{
int mid = (low + high) / 2;
if (a[mid] == key)
{
pos = mid;
break;
}
else if (key < a[mid])
high = mid - 1;
else
low = mid + 1;
} - if (pos != -1)
System.out.println("Found at index " + pos);
else
System.out.println("Not found");
}
} - Trace 'R': mid 3 ('K' < 'R') → low 4; mid 5 ('R') → found at 5.
- Trace 'C': mid 3 ('K' > 'C') → high 2; mid 1 ('D' > 'C') → high 0; mid 0 ('B' < 'C') → low 1; low > high → Not found. chars are compared with == and <, and the given sorted array is not re-sorted.
Answer: Sample runs:
Character: R
Found at index 5
Character: C
Not found
Example 7: Matrix sums · 15 marks · Long answerHOTS / competency
Write a program to accept a 3 × 3 integer matrix, display it in matrix form, and print the sum of each row, each column, the left diagonal and the right diagonal.
Try it first, then show the solutionSolution
- import java.util.Scanner;
class MatrixSums
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int m[][] = new int[3][3];
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
m[i][j] = sc.nextInt(); - for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
System.out.print(m[i][j] + "\t");
System.out.println();
} - for (int i = 0; i < 3; i++)
{
int r = 0, c = 0;
for (int j = 0; j < 3; j++)
{
r = r + m[i][j];
c = c + m[j][i];
}
System.out.println("Row " + i + ": " + r + " Column " + i + ": " + c);
} - int left = 0, right = 0;
for (int i = 0; i < 3; i++)
{
left = left + m[i][i];
right = right + m[i][2 - i];
}
System.out.println("Left diagonal: " + left + " Right diagonal: " + right);
}
} - Trace with 2 7 6 / 9 5 1 / 4 3 8: every row and column sums to 15; left = 2 + 5 + 8 = 15; right = 6 + 5 + 4 = 15.
Answer: Output for 2 7 6 9 5 1 4 3 8 (matrix values separated by tabs):
2 7 6
9 5 1
4 3 8
Row 0: 15 Column 0: 15
Row 1: 15 Column 1: 15
Row 2: 15 Column 2: 15
Left diagonal: 15 Right diagonal: 15
Case-study practice (Section B style)
Read the situation, then answer every part. In the board paper this is a 10-mark question split into 2 + 3 + 5 marks.
Searching a sorted roll list
Imagine a school stores 1,000 roll numbers in ascending order in an array. A clerk's program searches for a roll number with a for loop from the start. A student suggests binary search; another student says 'sort first with bubble sort, then binary search' every time a search is made.
(i) · 2 marks
Which search is the clerk using, and what is its drawback here?
Answer
Answer: Linear search; in the worst case it compares all 1,000 elements.
1 mark each.
(ii) · 3 marks
Why is binary search suitable, and about how many comparisons does it need at most?
Answer
Answer: The array is already sorted, so binary search can halve the range each step: 1000 → 500 → 250 → ... → 1 takes about 10 comparisons at most.
Reason 2 marks; count 1 mark.
(iii) · 5 marks
Is sorting before every search sensible? Explain, and write the core loop of binary search.
Answer
Answer: No. The array is already sorted; sorting again each time wastes many comparisons and swaps. Core loop:
while (low <= high)
{
mid = (low + high) / 2;
if (a[mid] == key) { pos = mid; break; }
else if (key < a[mid]) high = mid - 1;
else low = mid + 1;
}Reason 2 marks; loop 3 marks.
Where the marks are
How a typical answer is split into step marks. Show every step: a right final answer alone rarely earns full marks.
Show the array after each pass of bubble sort. (2 marks) (2 marks)
| Step | Marks |
|---|---|
| Correct adjacent comparisons and swaps in pass 1. | 1 |
| Correct arrays for the remaining passes. | 1 |
Binary search on a given sorted array with messages. (15 marks) (15 marks)
| Step | Marks |
|---|---|
| Array initialised exactly as given; key accepted. | 3 |
| low, high initialised; while (low <= high). | 2 |
| mid calculated inside the loop. | 2 |
| Comparison and correct update of low/high. | 4 |
| Found: position stored / break. | 2 |
| Only one correct message printed. | 2 |
Where students lose marks in Arrays
The slips examiners see most often, and what to write instead.
Mistake: Using a different technique from the one asked
In 2024 some used insertion or bubble sort when selection sort was required; in 2025 some used linear search for binary search.
Do this: Write exactly the named technique.
Usually costs: Most of the 15 marks.
Mistake: Loop bounds 1 to 4 for a 4 × 4 array
Reported in the 2025 NORM program.
Do this: Indexes run 0 to 3: for (i = 0; i < 4; i++).
Usually costs: 2 to 3 marks.
Mistake: Inverted comparison or incorrect swap
The 2024 examiners reported both in the selection sort.
Do this: Swap with a temporary variable: t = a[i]; a[i] = a[min]; a[min] = t;
Usually costs: 2 to 4 marks.
Mistake: Confusing length with length()
The 2025 MCQ on the last index caught many.
Do this: Array: a.length; String: s.length().
Usually costs: 1 mark.
Mistake: Printing both messages in a search
In 2025 candidates printed 'successful' and 'not successful' together.
Do this: Use a position/flag variable (or System.exit(0) on success) and print one message after the loop.
Usually costs: 1 to 2 marks.
Mistake: Sum not initialised or square root missed
Reported in the 2025 NORM program.
Do this: sum = 0 before the loops; Math.sqrt(sum) at the end.
Usually costs: 2 to 3 marks.
Practice questions on Arrays
Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.
Q1 · 1 mark · MCQBoard level
int a[] = new int[8]; occupies:
(a) 8 bytes
(b) 16 bytes
(c) 32 bytes
(d) 64 bytesHint
8 × 4.
Answer
(c) 32 bytes
Q2 · 1 mark · MCQBoard level
String c[] = {"Green", "Red", "Indigo"}; System.out.println(c[2].length()); prints:
(a) 3
(b) 6
(c) 2
(d) 5Hint
Length of Indigo.
Answer
(b) 6
Q3 · 2 marks · Very short answerBoard level
Write a statement to initialise the first six even numbers in a 3 × 2 array named e.
Hint
Rows in inner braces.
Answer
int e[][] = {{2, 4}, {6, 8}, {10, 12}};
Q4 · 2 marks · Very short answerHarder board level
Give the output:
int a[] = {5, 2, 8, 1};
int s = 0;
for (int i = a.length - 1; i >= 0; i -= 2)
s = s + a[i];
System.out.println(s);Hint
Indexes 3 and 1.
Answer
3 (a[3] + a[1] = 1 + 2)
Q5 · 2 marks · Very short answerHarder board level
Give the output:
int m[][] = {{1, 2, 3}, {4, 5, 6}};
System.out.println(m.length + " " + m[0].length + " " + m[1][2]);Hint
Rows, columns.
Answer
2 3 6
Q6 · 2 marks · Short answerHOTS / competency
Why does binary search fail on {9, 3, 7, 1, 5} when searching for 3?
Hint
Trace mid.
Answer
The array is not sorted. mid = 2 holds 7; 3 < 7 so the search goes left: mid = 0 holds 9; 3 < 9 so high becomes −1 and it stops, reporting not found although 3 is at index 1.
Q7 · 15 marks · Long answerHarder board level
Write a program to accept 10 integers into an array and print the largest and smallest values and their positions (indexes).
Hint
Start with a[0].
Answer
import java.util.Scanner;
class MaxMin
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int a[] = new int[10];
for (int i = 0; i < 10; i++)
a[i] = sc.nextInt();
int max = a[0], min = a[0], pmax = 0, pmin = 0;
for (int i = 1; i < 10; i++)
{
if (a[i] > max) { max = a[i]; pmax = i; }
if (a[i] < min) { min = a[i]; pmin = i; }
}
System.out.println("Largest " + max + " at " + pmax);
System.out.println("Smallest " + min + " at " + pmin);
}
}
Trace with 4 17 9 -3 12 8 17 0 5 6: Largest 17 at 1 (first occurrence, since > not >=); Smallest -3 at 3.Q8 · 15 marks · Long answerHOTS / competency
Write a program to accept a 4 × 4 integer array and print the square root of the sum of the squares of all its elements.
Hint
Initialise sum to 0; Math.sqrt at the end.
Answer
import java.util.Scanner;
class SqrtSum
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int a[][] = new int[4][4];
long sum = 0;
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
{
a[i][j] = sc.nextInt();
sum = sum + a[i][j] * a[i][j];
}
System.out.println("Result = " + Math.sqrt(sum));
}
}
Trace with all sixteen elements equal to 2: sum = 16 × 4 = 64; Math.sqrt(64) = 8.0 → Result = 8.0.Q9 · 2 marks · Very short answerBoard level
State one difference between selection sort and bubble sort.
Hint
What moves.
Answer
Selection sort finds the smallest element of the unsorted part and swaps it into place once per pass, whereas bubble sort compares adjacent elements and swaps them whenever they are out of order, moving the largest to the end each pass.
Test your recall
Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.
1.First index of an array?Show answer
0
2.Which search needs a sorted array?Show answer
Binary search.
3.Number of elements in int m[3][4]?Show answer
12
4.Right diagonal condition in n × n?Show answer
i + j == n − 1
5.Bytes in char c[4][3]?Show answer
24
Best order to study it
- 1D arrays: declare, initialise, input, access, length.
- Selection sort with pass-by-pass traces.
- Bubble sort with traces.
- Linear search; binary search with traces.
- 2D arrays: declare, input, display; row, column, diagonal sums.
- Write each sort and search from memory.
Quick revision checklist
The night before the exam: can you do each of these without looking?
- Array: same type, one name, index 0 to length − 1.
- a.length for arrays; s.length() for Strings.
- Selection: select min, swap once per pass; bubble: swap adjacent pairs.
- Linear: any array; binary: sorted array, mid = (low + high) / 2.
- 2D: m[i][j]; left diagonal i == j; right i + j == n − 1.
- Sorting and searching only on 1D arrays.
Arrays: frequently asked questions
Do I need insertion sort?
No. The syllabus names only selection sort and bubble sort; using another sort when one is specified loses marks.
Are sorting and searching asked on 2D arrays?
No. They are on single dimensional arrays only; 2D arrays are for sums and display.
Can I use Arrays.sort()?
No. Board questions require you to write the sorting technique yourself.
Based on: CISCE ICSE 2027 Computer Applications syllabus; CISCE Analysis of Pupil Performance ICSE 2025: Computer Applications (with the 2025 board paper)