Previous Year Question Papers for Class 12 Computer Science
Access comprehensive previous year question papers for Class 12 Computer Science using the ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions. Designed to align with the 2026-27 ISC academic guidelines, these solved papers help students assess their exam readiness and understand official marking schemes.
Practice Class 12 Computer Science Exam Papers
Navigate directly to the solved Computer Science question papers using the digital viewer below. Each practice set includes detailed solutions, allowing students to instantly cross-check their work and identify areas requiring further revision.
ISC Class 12 Computer Science Board Exam Question Paper with Solutions
PART I - 20 MARKS
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning, wherever required.
Question 1
(i) The complement of the Boolean expression (A - B') + (B' - C) is: [1 Mark]
(A) (A + B') - (B' + C)
(B) (A' - B) + (B - C)
(C) (A' + B) - (B + C)
(D) (A - B') + (B - C)
Answer: (C) (A' + B) - (B + C)
((A - B') + (B' - C))' = (A - B')' - (B' - C)' = (A' + B) - (B + C)
Teacher's Note:
a) Apply De Morgan's Law \((X + Y)' = X' \cdot Y'\) to find the complement.
b) Remember that the complement of a primed variable becomes unprimed and vice versa.
(ii) Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option. [1 Mark]
Assertion: The expression ~ (X v Y) is logically equivalent to (~X ^ ~Y)
Reason: The commutative property of logical operators states that the order of the operands does not change the result of a binary operation.
(A) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(B) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(C) Assertion is true and Reason is false.
(D) Both Assertion and Reason are false.
Answer: (B) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
De Morgan's law states that ~ (X v Y) = ~X ^ ~Y, making the assertion true. Commutative law states X v Y = Y v X and X ^ Y = Y ^ X, making the reason true, but it is not the explanation for De Morgan's law.
Teacher's Note:
a) De Morgan's laws govern the distribution of negation over disjunction and conjunction.
b) Verify each statement independently before establishing the causal relationship.
(iii) According to the Principle of Duality, the Boolean equation (1 + Y) - (X + Y) = Y + X' will be equivalent to: [1 Mark]
(A) (1 + Y) - (X + Y) = Y' + X
(B) (0 - Y) + (X - Y) = Y - X'
(C) (0 + Y) - (X + Y) = Y + X'
(D) (1 - Y) + (X - Y) = Y - X'
Answer: (B) (0 - Y) + (X - Y) = Y - X'
Replacing AND (.) with OR (+) and OR (+) with AND (-), and replacing 1 with 0 and 0 with 1.
Teacher's Note:
a) Dual of an expression swaps + and -, and 1 and 0.
b) Variables themselves remain unchanged during dual formation.
(iv) The Associative Law states that: [1 Mark]
(A) A - B = B - A
(B) A + B = B + A
(C) A - (B + C) = A - B + A - C
(D) A + (B + C) = (A + B) + C
Answer: (D) A + (B + C) = (A + B) + C
Associative law allows grouping of variables in AND or OR operations without changing the result.
Teacher's Note:
a) Know the difference between commutative, associative, and distributive laws.
b) Association changes grouping, commutation changes order.
(v) Consider the following code statement: [1 Mark]
public class Person
{
int age;
public Person (int age)
{
this.age = age;
}
}
Which of the following statements are valid for the given code?
I. The keyword this in the constructor refers to the current instance of the class.
II. The keyword this differentiates between the instance variable age and the parameter age.
III. The keyword this can be used only in constructors.
(A) Only I and II
(B) Only II and III
(C) Only I and III
(D) Only III
Answer: (A) Only I and II
The keyword 'this' refers to the current object and can also be used in instance methods, not exclusively in constructors.
Teacher's Note:
a) 'this' helps resolve shadowing between local parameters and instance variables.
b) 'this' can be used anywhere inside non-static methods or constructors.
(vi) Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option. [1 Mark]
Assertion: The break statement prevents fall through effect in switch case construct.
Reason: The break statement enables unnatural exit from the loop.
(A) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(B) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(C) Assertion is true and Reason is false.
(D) Both Assertion and Reason are false.
Answer: (B) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
Both statements describe valid behaviors of the break statement in different control structures.
Teacher's Note:
a) Break halts execution flow in switches and loops.
b) Reason correctly describes loop termination but does not explain the switch fall-through mechanism.
(vii) The canonical expression of F(P, Q, R) = pi(2, 5, 7) is: [1 Mark]
(A) (P + Q' + R) - (P' + Q + R') - (P' + Q' + R')
(B) (P - Q' - R) - (P' - Q - R') - (P' - Q' - R')
(C) (P + Q + R') - (P' + Q' + R) - (P + Q + R)
(D) (P' - Q - R') - (P - Q' - R) - (P - Q - R)
Answer: (A) (P + Q' + R) - (P' + Q + R') - (P' + Q' + R')
Maxterms for 2 (010), 5 (101), 7 (111) are (P + Q' + R), (P' + Q + R'), and (P' + Q' + R').
Teacher's Note:
a) Maxterms have 0 for normal form and 1 for primed form.
b) pi denotes Product of Sums (POS).
(viii) Study the given propositions and the statements marked, Assertion and Reason that follow it. Choose the correct option on the basis of your analysis. [1 Mark]
P - It is a holiday
Q - It is a Sunday
Assertion: If it is not a Sunday, then it is not a holiday. (Q' => P')
Reason: Inverse is formed when antecedent and consequent are interchanged.
(A) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(B) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(C) Assertion is true and Reason is false.
(D) Both Assertion and Reason are false.
Answer: (D) Both Assertion and Reason are false.
Inverse of Q => P is ~Q => ~P (negated, not interchanged). Interchanging gives converse.
Teacher's Note:
a) Inverse negates both components without changing their positions.
b) Converse swaps antecedent and consequent.
(ix) For the given code segment, write Big O notation for worst case complexity. [1 Mark]
for (int i = 1; i <= P; i++)
{ Statements }
for (int j = 1; j <= P; ++j)
{ Statements }
for (int k = 1; k <= Q; k++)
{ Statements }
Answer: O(P - Q)
The loops run P times, P times, and Q times sequentially, giving O(P + P + Q) = O(2P + Q) which simplifies to O(P - Q).
Teacher's Note:
a) Sequential loops add their time complexities.
b) Constants are dropped in Big O notation.
(x) Write the minterms in canonical form for the Boolean Function X (A, B), from the truth table given below: [1 Mark]
| A | B | X |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Answer: A'B' + AB
Rows where X = 1 are (0,0) yielding A'B' and (1,1) yielding AB.
Teacher's Note:
a) Minterms represent standard product terms where 0 is primed and 1 is unprimed.
b) Sum of minterms constitutes the SOP expression.
Question 2
(i) Convert the following infix notation to postfix form. [2 Marks]
(A - B) / C + (D * E / F) * G
Answer:
= AB - / C + DE * F / G * +
= AB - C / + DE * F / G * + (or equivalent standard postfix)
Teacher's Note:
a) Evaluate operations based on operator precedence and parentheses.
b) Convert terms step-by-step from inside out.
(ii) A matrix M [-1..10, 4..13] is stored in the memory with each element requiring 2 bytes of storage. If the base address is 1200, find the address of M[2][7] when the matrix is stored Row Major Wise. [2 Marks]
Answer: Address(M[2,7]) = 1266
Address = B + W * [C * (I - LR) + (J - LC)]
Base (B) = 1200, W = 2, LR = -1, UR = 10, LC = 4, UC = 13
Number of columns (C) = 13 - 4 + 1 = 10
Address = 1200 + 2 * [10 * (2 - (-1)) + (7 - 4)]
= 1200 + 2 * [10 * 3 + 3] = 1200 + 2 * [33] = 1200 + 66 = 1266.
Teacher's Note:
a) Calculate total columns using upper and lower bounds.
b) Apply Row Major formula carefully noting negative lower bounds.
(iii) The following function int solve() is a part of some class. Assume 'm' and 'n' are positive integers. Answer the questions given below with dry run/working. [3 Marks]
int solve(int m, int n)
{
int k = 1;
if (m < 0)
return -k;
else if (m == 0)
return m;
else
return k + (solve(m - n, n + 2));
}
(a) What will the function solve() return if:
(1) m = 16, n = 1
(2) m = 9, n = 1
(b) What is the function solve() performing apart from recursion?
Answer:
(a) (1) Returns 4. (2) Returns 3.
(b) It counts the number of steps required to reduce 'm' to 0 by subtracting increasing odd numbers (n, n+2, n+4...).
Teacher's Note:
a) Perform dry run carefully tracking each recursive call.
b) Identify the arithmetic progression pattern in recursive steps.
(iv) The following function duck() is a part of some class which is used to check if a given number is a duck number or not. There are some places in the code marked by ?1?, ?2?, ?3? which may be replaced by a statement / expression so that the function works properly. [3 Marks]
A number is said to be Duck if the digit zero (0) is present in it.
boolean duck(int a)
{
int f = -1;
if(a == 0)
return true;
for(int i = a; i = 0; ?1?)
{
int c = i % 10;
if(c == ?2?)
{ f = 1; break; }
}
return (f == ?3?)? false : true;
}
(a) What is the expression or statement at ?1? [1 Mark]
(b) What is the expression or statement at ?2? [1 Mark]
(c) What is the expression or statement at ?3? [1 Mark]
Answer:
(a) i = i / 10
(b) 0
(c) -1
Teacher's Note:
a) Understand how integer extraction digit-by-digit works using modulo and division.
b) Match flag conditions initialized in the method.
PART II - 50 MARKS
Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C.
SECTION - A
Answer any two questions.
Question 3
(i) A superhero is allowed access to a secure Avengers facility if he / she meets any of the following criteria: [5 Marks]
- The superhero has Avengers' membership and possesses a high-security clearance badge
OR
- The superhero does not have Avengers membership but holds a special permit issued by S.H.I.E.L.D. along with a high-security clearance badge
OR
- The superhero is not a recognised ally but holds a special permit issued by S.H.I.E.L.D. along with a high-security clearance badge.
The inputs are:
| INPUTS | |
|---|---|
| A | Superhero has Avengers membership. |
| S | Superhero holds a special permit issued by S.H.I.E.L.D. |
| C | Superhero possesses a high-security clearance badge |
| L | Superhero is a recognised ally |
(In all the above cases, 1 indicates YES and 0 indicates NO)
Output: X - Denotes allowed access [1 indicates YES and 0 indicates NO in all cases]
Draw the truth table for the inputs and outputs given above. Write the POS expression for X (A, S, C, L).
Reduce the above expression X (A, S, C, L) by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs). [5 Marks]
Draw the logic gate diagram using NOR gates only for the reduced expression. Assume that the variables and their complements are available as inputs.
Answer:
Truth Table, POS expression pi(0, 1, 2, 3, 4, 5, 7, 8, 9, 12, 13), reduced POS expression: C(A + S)(A + L'), and its NOR logic diagram.
Teacher's Note:
a) Carefully derive minterms/maxterms from the problem description.
b) Apply K-map grouping for POS (looking for 0s) and implement using universal NOR gates.
Question 4
(i) (a) Reduce the Boolean function F(P, Q, R, S) = Sigma(0, 1, 2, 5, 7, 8, 9, 10, 13, 15) by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs). [4 Marks]
(b) Draw the logic gate diagram using NAND gates only for the reduced expression. Assume that the variables and their complements are available as inputs. [1 Mark]
Answer:
Reduced SOP expression: Q'R' + A'B (or equivalent in P,Q,R,S terms like Q'S' + P'S + Q'R'), and its NAND logic diagram.
Teacher's Note:
a) Group adjacent 1s in powers of 2 for SOP.
b) Use double negation and De Morgan's law to convert SOP to pure NAND logic.
(ii) From the logic gate diagram given below:
[Figure: Logic diagram with inputs A and B connected to gates producing outputs (1), (2), and combined into R]
(a) Derive Boolean expression for (1), (2) and R. Reduce the derived expression. [4 Marks]
(b) Name the logic gate that represents the reduced expression. [1 Mark]
Answer:
(a) Reduced expression = A'B + AB'
(b) XOR gate
Teacher's Note:
a) Trace outputs gate by gate from inputs.
b) Simplify Boolean algebraic expressions using standard laws.
Question 5
(i) What is an encoder? Draw the logic gate diagram for an octal to binary encoder. State one application of a decoder. [5 Marks]
Answer:
Encoder is a combinational circuit that converts multiple input lines into a coded binary output. Diagram shows 8 inputs to 3 outputs (Y2, Y1, Y0). Application: Memory address decoding / Seven segment display.
Teacher's Note:
a) Encoder performs the reverse operation of a decoder.
b) Clearly draw input lines D0-D7 and output encoder gates.
(ii) By using truth table, verify if the following proposition is valid or not. [3 Marks]
(~X => Y) ^ X = (X ^ ~Y) v (X ^ Y)
Answer:
Truth table columns match identically, proving the proposition is valid (a tautology equivalent).
Teacher's Note:
a) Construct columns for each sub-expression.
b) Verify if final columns match across equivalence.
(iii) Study the logic gate diagram given below and answer the questions that follow:
[Figure: XOR gate with inputs A and B]
What will be the output of the above gate when:
(a) A = 1, B = 0 [1 Mark]
(b) A = 1, B = 1 [1 Mark]
Answer:
(a) Output = 1
(b) Output = 0
Teacher's Note:
a) Identify the gate as an XOR gate.
b) XOR outputs 1 when inputs are different.
SECTION - B
Answer any two questions.
Question 6
A class Perni has been defined to accept a positive integer in binary number system from the user and display if it is a pernicious number or not. [10 Marks]
[A pernicious number is a binary number that has minimum of two digits and has prime number of 1's in it.]
Examples:
- 101 is a pernicious number as the number of 1's in 101 = 2 and 2 is prime number.
- 10110 is a pernicious number as the number of 1's in 10110 = 3 and 3 is prime number.
- 1111 is a NOT a pernicious number as the number of 1's in 1111 = 4 and 4 is NOT a prime number.
The details of the members of the class are given below:
Class name: Perni
Data member/instance variable:
- num: to store a binary number
Methods/Member functions:
- Perni(): constructor to initialise the data member with 0
- void accept(): to accept a binary number (containing 0's and 1's only)
- int countOne(int k): to count and return the number of 1's in 'k' using recursive technique
- void check(): to check whether the given number is a pernicious number by invoking the function countOne() and to display an appropriate message
Specify the class Perni giving the details of the constructor(), void accept(), int countOne(int) and void check(). Define a main() function to create an object and call the functions accordingly to enable the task.
Answer:
Java Program for Class Perni
import java.util.Scanner;
class Perni
{
private String num;
Perni()
{
num = "";
}
void accept()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a binary number: ");
num = sc.next();
if (!num.matches("[01]+"))
{
System.out.println("Invalid input!");
System.exit(0);
}
}
int countOne(String binary)
{
int count = 0;
for (char c : binary.toCharArray())
{
if (c == '1') count++;
}
return count;
}
void check()
{
int decimalNum = Integer.parseInt(num, 2);
int onesCount = countOne(num);
if (isPrime(onesCount))
{
System.out.println(num + " is a pernicious number.");
}
else
{
System.out.println(num + " is NOT a pernicious number.");
}
}
boolean isPrime(int n)
{
if (n < 2) return false;
for (int i = 2; i * i <= n; i++)
{
if (n % i == 0) return false;
}
return true;
}
public static void main(String[] args)
{
Perni obj = new Perni();
obj.accept();
obj.check();
}
}
Teacher's Note:
a) Ensure validation checks for binary inputs are robust.
b) Implement prime checking correctly for the count of 1s.
Question 7
Design a class Colsum to check if the sum of elements in each corresponding column of two matrices is equal or not. Assume that the two matrices have the same dimensions. [10 Marks]
Example:
Input: Matrix A and Matrix B with matching dimensions. Output: Sum of corresponding columns is equal.
Answer:
Java Program for Class Colsum
import java.util.Scanner;
class Colsum
{
private int[][] mat;
private int m, n;
public Colsum(int mm, int nn)
{
m = mm;
n = nn;
mat = new int[m][n];
}
public void readArray()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter elements of the matrix:");
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
mat[i][j] = sc.nextInt();
}
}
}
public void print()
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
System.out.print(mat[i][j] + " ");
}
System.out.println();
}
}
public static boolean check(Colsum A, Colsum B)
{
for (int j = 0; j < A.n; j++)
{
int sumA = 0, sumB = 0;
for (int i = 0; i < A.m; i++)
{
sumA += A.mat[i][j];
sumB += B.mat[i][j];
}
if (sumA != sumB)
{
return false;
}
}
return true;
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter rows: ");
int rows = sc.nextInt();
System.out.print("Enter columns: ");
int cols = sc.nextInt();
Colsum A = new Colsum(rows, cols);
Colsum B = new Colsum(rows, cols);
System.out.println("Enter values for Matrix A:");
A.readArray();
System.out.println("Enter values for Matrix B:");
B.readArray();
if (Colsum.check(A, B))
{
System.out.println("Sum of corresponding columns is equal.");
}
else
{
System.out.println("Sum of corresponding columns is not equal.");
}
}
}
Teacher's Note:
a) Iterate column-wise by fixing column index in the outer loop.
b) Compare column sums across both object instances.
Question 8
A class Flipgram has been defined to flip the letters of the left and right halves of a non-heterogram word. If the word has odd number of characters, then the middle letter remains at its own position. [10 Marks]
A heterogram is a word where no letter appears more than once.
Example 1: INPUT: BETTER, OUTPUT: TERBET
Example 2: INPUT: NEVER, OUTPUT: ERVNE
Example 3: INPUT: THAN, OUTPUT: HETEROGRAM
The details of the members of the class are given below:
Class name: Flipgram
Data members/instance variables:
- word: to store a word
Methods/Member functions:
- Flipgram(String s): parameterised constructor to assign word = s
- boolean ishetero(): to return true if word is a heterogram else return false
- String flip(): to interchange the left and right sides of a non-heterogram word and return the resultant word
- void display(): to print the flipped word for a non-heterogram word by invoking the method flip(). An appropriate message should be printed for heterogram word
Answer:
Java Program for Class Flipgram
import java.util.Scanner;
class Flipgram
{
private String word;
public Flipgram(String s)
{
word = s;
}
public boolean ishetero()
{
int len = word.length();
for (int i = 0; i < len; i++)
{
for (int j = i + 1; j < len; j++)
{
if (word.charAt(i) == word.charAt(j))
{
return false;
}
}
}
return true;
}
public String flip()
{
int len = word.length();
int mid = len / 2;
if (len % 2 == 0)
{
return word.substring(mid) + word.substring(0, mid);
}
else
{
return word.substring(mid + 1) + word.charAt(mid) + word.substring(0, mid);
}
}
public void display()
{
if (ishetero())
{
System.out.println("HETEROGRAM");
}
else
{
System.out.println("Flipped word: " + flip());
}
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a word: ");
String inputWord = sc.next();
Flipgram obj = new Flipgram(inputWord);
obj.display();
}
}
Teacher's Note:
a) Check for repeating characters to identify heterograms.
b) Use substring manipulation carefully handling odd and even length words.
SECTION - C
Answer any two questions.
Question 9
A circular queue is a linear data structure that allows data insertion at the rear and removal from the front, with the rear end connected to the front end forming a circular arrangement. [5 Marks]
The details of the members of the class are given below:
Class name: CirQueue
Data members/instance variables:
- Q[]: array to hold integer values
- cap: maximum capacity of the circular queue
- front: to point the index of the front
- rear: to point the index of the rear
Methods/Member functions:
- CirQueue(int n): constructor to initialise cap = n, front = 0 and rear = 0
- void push(int v): to add integers from the rear index if possible else display the message "QUEUE IS FULL"
- int remove(): to remove and return the integer from front if any, else return -999
- void print(): to display the elements of the circular queue in the order of front to rear
(i) Specify the class CirQueue giving the details of the functions void push(int) and int remove(). Assume that the other functions have been defined. The main() function and algorithm need NOT be written. [4 Marks]
(ii) State one application of a circular queue. [1 Mark]
Answer:
Java Code for CirQueue
class CirQueue
{
private int[] Q;
private int cap;
private int front;
private int rear;
public CirQueue(int n)
{
cap = n;
Q = new int[cap];
front = -1;
rear = -1;
}
public void push(int v)
{
if ((rear + 1) % cap == front)
{
System.out.println("QUEUE IS FULL");
return;
}
if (front == -1)
{
front = 0;
}
rear = (rear + 1) % cap;
Q[rear] = v;
}
public int remove()
{
if (front == -1)
{
return -999;
}
int removedValue = Q[front];
if (front == rear)
{
front = -1;
rear = -1;
}
else
{
front = (front + 1) % cap;
}
return removedValue;
}
}
(ii) Application: CPU Scheduling / Disk Scheduling / Memory Management.
Teacher's Note:
a) Implement circular wrapping using modulo arithmetic `(rear + 1) % cap`.
b) Check for empty and full queue boundary conditions.
Question 10
A superclass Flight has been defined to store the details of a flight. Define a subclass Passenger to calculate the fare for a passenger. [5 Marks]
The details of the members of both the classes are given below:
Class name: Flight
Data members/instance variables:
- flightno: to store the flight number in string
- dep_time: to store the departure time in string
- arr_time: to store the arrival time in string
- basefare: to store the base fare in decimal
Methods/Member functions:
- Flight(...): parameterised constructor to assign values to the data members
- void show(): to display the flight details
Class name: Passenger
Data members/instance variables:
- id: to store the ID of the passenger
- name: to store the name of the passenger
- tax: to store the tax to be paid in decimal
- tot: to store the total amount to be paid in decimal
Methods/Member functions:
- Passenger(...): parameterised constructor to assign values to the data members of both the classes
- void cal(): to calculate the tax as 5% of base fare and total amount (base fare + tax)
- void show(): to display the flight details along with the passenger details and total amount to be paid
Assume that the super class Flight has been defined. Using the concepts of Inheritance, specify the class Passenger giving the details of constructor(...), void cal() and void show(). The super class, main function and algorithm need NOT be written.
Answer:
Java Code for Subclass Passenger
class Passenger extends Flight
{
private String id;
private String name;
private double tax;
private double tot;
public Passenger(String flightno, String dep_time, String arr_time, double basefare, String id, String name)
{
super(flightno, dep_time, arr_time, basefare);
this.id = id;
this.name = name;
this.tax = 0.0;
this.tot = 0.0;
}
public void cal()
{
tax = 0.05 * basefare;
tot = basefare + tax;
}
public void show()
{
super.show();
System.out.println("Passenger ID: " + id);
System.out.println("Passenger Name: " + name);
System.out.println("Tax: " + tax);
System.out.println("Total Amount to be Paid: " + tot);
}
}
Teacher's Note:
a) Use `super()` in the subclass constructor to initialize inherited fields.
b) Invoke `super.show()` to reuse superclass display functionality.
Question 11
(i) A linked list is formed from the objects of the class Cell. The class structure of the Cell is given below: [2 Marks]
class Cell
{
char m;
Cell right;
}
Write an Algorithm OR a Method to print the sum of the ASCII values of the lower case alphabets present in the linked list.
The method declaration is as follows:
void lowercase(Cell str)
Answer:
Method lowercase
public static void lowercase(Cell str)
{
int sum = 0;
Cell temp = str;
while (temp != null)
{
if (Character.isLowerCase(temp.m))
{
sum += (int) temp.m;
}
temp = temp.right;
}
System.out.println("Sum of ASCII values of lowercase letters: " + sum);
}
Teacher's Note:
a) Traverse the linked list using a temporary pointer until null.
b) Check character case using `Character.isLowerCase()` before adding ASCII values.
(ii) Answer the following questions based on the Binary Tree given below:
[Figure: Binary tree rooted at A with children B and C, further branching into D, E, F, G, and leaf nodes I, J, K, L, M, N]
(a) Write the in-order traversal of the right subtree. [1 Mark]
(b) State the depth of the entire binary tree and depth of node E. [1 Mark]
(c) Name the external nodes of the left subtree and internal nodes of the right subtree. [1 Mark]
Answer:
(a) K, F, N, L, C, G, M
(b) Depth of binary tree = 4, Depth of node E = 2
(c) External nodes of left subtree: {I, J, E}; Internal nodes of right subtree: {C, F, G, L}
Teacher's Note:
a) In-order traversal follows Left - Root - Right recursively.
b) Tree depth is measured by maximum edges from root; external nodes are leaves, internal nodes have children.
Free study material for Computer Science
Past Exam Papers & Solutions for Class 12 Computer Science
Class 12 Computer Science Past Exam Papers & Resources
Explore downloadable past papers for Class 12 Computer Science. Utilizing the ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions ensures complete preparedness by offering clear insights into historical question styles and marking expectations.
Importance of Solving ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions
Regular simulation of exam environments using past question documents builds crucial pacing abilities and eliminates last-minute test anxiety during Class 12 Computer Science assessments.
Complete Your Exam Preparation
Pair your past paper revision with our official Class 12 Computer Science sample papers and online practice modules to achieve total curriculum mastery.
FAQs
The ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions is available for download on StudiesToday.com. It includes complete set with all sections so that Class 12 students can practice with the exact same paper that came in the ISC exams.
Yes, the solutions for ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions are prepared by subject matter experts as per official marking scheme. Class 12 students will understand the structure of answers and 'step-marks' methodology Computer Science.
Solving previous year papers like ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions is important to understand repeat themes and question difficulty levels of Computer Science. It helps Class 12 students to test their time management skills too.
Yes, where applicable, ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions is available in both English and Hindi mediums. All students from Class 12 can access Computer Science study material in their preferred language.
No, all previous year question papers on StudiesToday, including ISC Class 12 Computer Science Board Exam Question Paper 2025 with Solutions, are provided free of charge in mobile-friendly PDF.