Download ISC Class 12 Computer Science Question Papers
Review targeted exam resources with the ISC Class 12 Computer Science Board Exam Question Paper 2017 with Solutions. Built according to official ISC standards for the 2026-27 academic year, these downloadable Class 12 Computer Science question papers support effective revision and performance tracking.
Access ISC Question Papers and Solutions
View or download the dedicated ISC Class 12 Computer Science Board Exam Question Paper 2017 with Solutions resource below. Engaging with these previous year papers under timed conditions ensures continuous academic progress and mastery of the 2026-27 exam format.
ISC Class 12 Computer Science Board Exam Question Paper with Solutions 2017
Part - I (20 Marks)
Answer all questions.
Question 1.
(a) State the law represented by the following proposition and prove it with the help of a truth table: P ∨ P = P [1 mark]
Answer:
The law represented by the given proposition is Idempotent law.
Truth Table:
| P | P | P ∨ P | P ∨ P ⇔ P |
|---|---|---|---|
| T | T | T | T |
| F | F | F | T |
Teacher's Note:
a) The Idempotent law states that combining a proposition with itself using logical OR (or AND) yields the same proposition.
b) Students must include all necessary columns and show equivalence in the truth table to secure full marks.
(b) State the Principle of Duality. [1 mark]
Answer:
The duality principle states that every algebraic expression deducible from the postulates of Boolean algebra remains valid if the operators and identity elements are interchanged (i.e., + is replaced by ., . is replaced by +, 0 is replaced by 1, and 1 is replaced by 0).
Teacher's Note:
a) This is a fundamental principle in Boolean algebra useful for finding dual expressions.
b) Ensure both operators and identity elements are mentioned as interchanged in the definition.
(c) Find the complement of the following Boolean expression using De Morgan's law: F(a, b, c) = (b' + c) + a [1 mark]
Answer:
((b' + c) + a)'
= (b' + c)'. a'
= ((b')'. c') . a'
= bc'a'
Teacher's Note:
a) Apply De Morgan's law \((X + Y)' = X' \cdot Y'\) step by step.
b) Remember that the double negation \((b')'\) simplifies to \(b\).
(d) Draw the logic diagram and truth table for a 2 input XNOR gate. [1 mark]
Answer:
Truth Table:
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 1 | 1 |
[Figure: Logic diagram of a 2-input XNOR gate showing inputs A and B entering an exclusive-NOR shaped gate followed by a bubble to produce the Output, along with its equivalent gate circuit representation using AND, OR, and NOT gates]
Teacher's Note:
a) An XNOR gate produces a high (1) output when both inputs are the same.
b) Clearly draw the curved gate shape with the inversion bubble at the output.
(e) If (~P => Q) then write its: [1 mark]
(i) Inverse
(ii) Converse
Answer:
(i) Inverse: P => ~Q
(ii) Converse: Q => ~P
Teacher's Note:
a) The inverse of a conditional statement \(\text{A} \implies \text{B}\) negates both hypothesis and conclusion to yield \(\sim\text{A} \implies \sim\text{B}\).
b) The converse swaps the hypothesis and conclusion, yielding \(\text{B} \implies \text{A}\).
Question 2.
(a) What is an interface? How is it different from a class? [2 marks]
Answer:
An interface in Java is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. It is used to achieve abstraction and multiple inheritance in Java.
Differences:
1. An interface cannot be instantiated, whereas a class can be instantiated to create objects.
2. All methods in an interface are implicitly abstract (before Java 8), whereas a class can have method bodies and concrete implementations.
Teacher's Note:
a) Interfaces specify what a class must do, not how it does it.
b) Mentioning multiple inheritance is key when explaining the purpose of interfaces in Java.
(b) Convert the following infix expression to postfix form: P * Q / R + (S + T) [2 marks]
Answer:
PQ * R / ST + +
Teacher's Note:
a) Follow operator precedence: multiplication and division have higher precedence than addition.
b) Process parentheses first before applying operators to operands.
(c) A matrix P[15][10] is stored with each element requiring 8 bytes of storage. If the base address at P[0][0] is 1400, determine the address at P[10][7] when the matrix is stored in Row Major Wise. [2 marks]
Answer:
Row Major Address Formula: \(\text{Address}(P[i][j]) = B + W \times ((i - l_r) \times \text{column} + (j - l_c))\)
Given: \(B = 1400\), \(W = 8\), \(\text{column} = 10\), \(i = 10\), \(j = 7\), \(l_r = 0\), \(l_c = 0\).
\(\text{Address}(P[10][7]) = 1400 + 8 \times ((10 - 0) \times 10 + (7 - 0))\)
\(= 1400 + 8 \times (100 + 7)\)
\(= 1400 + 8 \times 107\)
\(= 1400 + 856 = 2256\)
Teacher's Note:
a) Always write the formula clearly before substituting values.
b) Double-check index bounds and base address calculations to avoid arithmetic errors.
(d) (i) What is the worst-case complexity of the following code segment: [2 marks]
for(int x = 1; x <= a; x++)
{
statements;
}
for(int y = 1; y <= b; y++)
{
for(int z = 1; z <= c; z++)
{\;
statements;
}
}
(ii) How would the complexity change if all the three loops went to N instead of a, b and c?
Answer:
(i) O(a + bc)
(ii) O(N2)
Teacher's Note:
a) The first loop runs 'a' times, and the nested loops run \(b \times c\) times independently in sequence, giving O(a + bc).
b) When all loop limits become N, the outer loop runs N times and the inner nested loop runs \(N \times N\) times, resulting in O(N + N2), which simplifies to O(N2).
(e) Differentiate between a constructor and a method of a class. [2 marks]
Answer:
| Constructor | Method |
|---|---|
| A constructor is used to initialize the state of an object. | A method is used to expose the behavior of an object. |
| A constructor must not have a return type. | A method must have a return type (or void). |
| Constructor name must be the same as the class name. | Method name may or may not be the same as the class name. |
Teacher's Note:
a) Constructors are invoked implicitly when an object is created using the new operator.
b) Methods must be explicitly called using the object reference.
Question 3.
The following function magicfun() is a part of some class. What will the function magicfun() return, when the value of n=7 and n=10, respectively? Show the dry run/working: [5 marks]
int magicfun (int n)
{
if(n == 0)
return 0;
else
return magicfun(n / 2) * 10 + (n % 2);
}
Answer:
For n = 7:
- magicfun(7) returns magicfun(3) * 10 + 1
- magicfun(3) returns magicfun(1) * 10 + 1
- magicfun(1) returns magicfun(0) * 10 + 1
- magicfun(0) returns 0
Evaluating backwards: 0 * 10 + 1 = 1; 1 * 10 + 1 = 11; 11 * 10 + 1 = 111.
Result for n = 7 is 111.
For n = 10:
- magicfun(10) returns magicfun(5) * 10 + 0
- magicfun(5) returns magicfun(2) * 10 + 1
- magicfun(2) returns magicfun(1) * 10 + 0
- magicfun(1) returns magicfun(0) * 10 + 1
- magicfun(0) returns 0
Evaluating backwards: 0 * 10 + 1 = 1; 1 * 10 + 0 = 10; 10 * 10 + 1 = 101; 101 * 10 + 0 = 1010.
Result for n = 10 is 1010.
The function computes the binary equivalent of a decimal number.
Teacher's Note:
a) This recursive function converts a decimal integer into its binary representation as a decimal number.
b) Showing step-by-step recursive calls and return values is essential for full credit.
SECTION - A
Answer any two questions.
Question 4.
(a) Given the Boolean function F(A, B, C, D) = Σ(2, 3, 4, 5, 6, 7, 8, 10, 11).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs). [4 marks]
(ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1 mark]
Answer:
(i) K-map grouping yields the reduced expression:
\(F(A, B, C, D) = A'C + A'B + B'C + AB'D'\)
(ii)
[Figure: Logic gate diagram showing NOT gates for inputs A, B, D, AND gates for product terms A'C, A'B, B'C, and AB'D', connected to a final OR gate to produce output F]
Teacher's Note:
a) Form largest possible groups of 1s (octals, quads, pairs) to achieve minimal SOP expression.
b) Ensure all inputs and intermediate gates are correctly labeled in the logic diagram.
(b) Given the Boolean function F(P, Q, R, S) = π(0, 1, 2, 4, 5, 6, 8, 10).
(i) Reduce the above expression by using the 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs). [4 marks]
(ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1 mark]
Answer:
(i) K-map grouping for maxterms yields the reduced POS expression:
\(F(P, Q, R, S) = (A + C)(A + D)(B + D)\) (using standard mapped variables P, Q, R, S as corresponding inputs A, B, C, D respectively: \((P + R)(P + S)(Q + S)\)).
(ii)
[Figure: Logic gate diagram showing OR gates for sum terms (P + R), (P + S), and (Q + S), feeding into a final AND gate to produce output F]
Teacher's Note:
a) For Product of Sums (POS), group 0s on the K-map.
b) Remember that POS expressions combine sum terms using AND operations.
Question 5.
(a) A school intends to select candidates for an Inter-School Essay Competition as per the criteria given below: [5 marks]
The student has participated in an earlier competition and is very creative.
OR
The student is very creative and has excellent general awareness, but has not participated in any competition earlier.
OR
The student has excellent general awareness and has won a prize in an inter-house competition.
The inputs are:
A: participated in a competition earlier
B: is very creative
C: won a prize in an inter-house competition
D: has an excellent general awareness
(In all the above cases 1 indicates yes and 0 indicates no).
Output: X [1 indicates yes, 0 indicates no for all cases]
Draw the truth table for the inputs and outputs given above and write the POS expression for X(A, B, C, D).
Answer:
Truth Table:
| A | B | C | D | X | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | \(m_0\) |
| 0 | 0 | 0 | 1 | 0 | \(m_1\) |
| 0 | 0 | 1 | 0 | 0 | \(m_2\) |
| 0 | 0 | 1 | 1 | 1 | \(m_3\) |
| 0 | 1 | 0 | 0 | 0 | \(m_4\) |
| 0 | 1 | 0 | 1 | 1 | \(m_5\) |
| 0 | 1 | 1 | 0 | 0 | \(m_6\) |
| 0 | 1 | 1 | 1 | 1 | \(m_7\) |
| 1 | 0 | 0 | 0 | 0 | \(m_8\) |
| 1 | 0 | 0 | 1 | 0 | \(m_9\) |
| 1 | 0 | 1 | 0 | 0 | \(m_{10}\) |
| 1 | 0 | 1 | 1 | 1 | \(m_{11}\) |
| 1 | 1 | 0 | 0 | 1 | \(m_{12}\) |
| 1 | 1 | 0 | 1 | 1 | \(m_{13}\) |
| 1 | 1 | 1 | 0 | 1 | \(m_{14}\) |
| 1 | 1 | 1 | 1 | 1 | \(m_{15}\) |
The POS expression is:
\(X(A, B, C, D) = \pi(0, 1, 2, 4, 6, 8, 9, 10)\)
Teacher's Note:
a) Carefully evaluate each row based on the given problem statement conditions.
b) POS expression collects the maxterm indices where output X is 0.
(b) State the application of a Half Adder. Draw the truth table and circuit diagram for a Half Adder. [3 marks]
Answer:
Application: A half adder is used in digital computers for adding two single-bit binary numbers.
Truth Table:
| Inputs | Outputs | ||
|---|---|---|---|
| A | B | Sum (S) | Carry (C) |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
[Figure: Circuit diagram of a half adder showing an XOR gate for Sum (S) and an AND gate for Carry (C) taking inputs A and B]
Teacher's Note:
a) Half adders cannot handle a carry-in from a previous addition; hence full adders are used for multi-bit addition.
b) Verify that Sum uses an XOR gate and Carry uses an AND gate.
(c) Convert the following Boolean expression into its canonical POS form: F(A, B, C) = (B + C').(A' + B) [2 marks]
Answer:
\((B + C') = (B + C' + A \cdot A') = (B + C' + A)(B + C' + A')\)
\((A' + B) = (A' + B + C \cdot C') = (A' + B + C)(A' + B + C')\)
Combining both terms:
\(F(A, B, C) = (A + B + C')(A' + B + C')(A' + B + C)\)
Teacher's Note:
a) To convert to canonical POS, introduce missing variables using the identity \(X \cdot X' = 0\) and distributive law \(X + YZ = (X+Y)(X+Z)\).
b) Remove any duplicate terms in the final expanded expression.
Question 6.
(a) What is a Multiplexer? How is it different from a decoder? Draw the circuit diagram for a 8 : 1 Multiplexer. [5 marks]
Answer:
A multiplexer is a combinational circuit that selects one of many input data lines and directs it to a single output line based on select lines.
Difference: A multiplexer selects one out of many inputs to a single output, whereas a decoder converts n input lines to \(2^n\) unique output lines.
[Figure: Circuit diagram of an 8:1 Multiplexer showing 8 data inputs (IN0 to IN7), 3 select lines (S2, S1, S0), enable input E, and a single output Y driven by AND gates and an OR gate]
Teacher's Note:
a) Multiplexers are widely used in data routing and communication systems.
b) Ensure all 8 input lines and select lines are clearly indicated in the diagram.
(b) Prove the Boolean expression using Boolean laws. Also, mention the law used at each step.
F = (x' + z) + [(y' + z).(x' + y)]' = 1 [3 marks]
Answer:
\(F = (x' + z) + [(y' + z).(x' + y)]'\)
\(= x' + z + (y' + z)' + (x' + y)'\) [De Morgan's Law]
\(= x' + z + y \cdot z' + x \cdot y'\) [De Morgan's Law & Double Negation]
\(= x' + x \cdot y' + z + y \cdot z'\) [Commutative Law]
\(= x' + y' + z + y\) [Absorption Law: \(a + a'b = a + b\)]
\(= x' + z + y' + y\) [Commutative Law]
\(= x' + z + 1\) [Complement Law: \(y' + y = 1\)]
\(= 1\) [Dominance / Annulment Law: \(a + 1 = 1\)]
Teacher's Note:
a) State the laws clearly at each step to earn full marks.
b) De Morgan's Law and distributive/absorption laws are frequently tested in Boolean proofs.
(c) Define maxterms and minterms. Find the maxterm and minterm when: P = 0, Q = 1, R = 1 and S = 0 [2 marks]
Answer:
Minterm: A product (AND) of all variables in direct or complemented form that produces a 1 for a specific combination of variables.
Maxterm: A sum (OR) of all variables in direct or complemented form that produces a 0 for a specific combination of variables.
Given \(P = 0, Q = 1, R = 1, S = 0\):
Minterm = \(P'QRS'\)
Maxterm = \((P + Q' + R' + S)\)
Teacher's Note:
a) In minterms, 0 is represented with a complement and 1 without.
b) In maxterms, 1 is represented with a complement and 0 without.
SECTION - B
Answer any two questions.
Question 7.
A class Palin has been defined to check whether a positive number is a Palindrome number or not. [10 marks]
The number 'N' is palindrome if the original number and it's reverse are the same.
Some of the members of the class are given below:
Class name: Palin
Data members/instance variables:
num: integer to store the number
revnum: integer to store the reverse of the number
Methods/Member functions:
Palin(): constructor to initialize data members with legal initial values
void accept(): to accept the number
int reverse(int y): reverses the parameterized argument 'y' and stores it in revnum using a recursive technique
void check(): checks whether the number is a Palindrome by invoking the function reverse() and display the result with an appropriate message
Specify the class Palin giving the details of the constructor(), void accept(), int reverse(int) and void check(). Define the main() function to create an object and call the functions accordingly to enable the task.
Answer:
import java.io.*;
class Palin {
int num;
int revnum;
Palin() {
num = 0;
revnum = 0;
}
void accept() throws IOException {
BufferedReader y = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the Number: ");
num = Integer.parseInt(y.readLine());
}
int reverse(int y) {
int len = (y + "").length();
if(len == 1) {
return y;
}
else {
return (((y % 10) * (int) Math.pow(10, len - 1)) + reverse(y / 10));
}
}
void check() {
revnum = reverse(num);
if(num == revnum) {
System.out.println("Number is palindrome");
}
else {
System.out.println("Number is not palindrome");
}
}
public static void main(String args[]) throws IOException {
Palin p = new Palin();
p.accept();
p.check();
}
}
Teacher's Note:
a) Check for proper handling of recursive base cases and string length conversion.
b) Ensure all specified instance variables and method signatures match the question requirements.
Question 8.
A class Adder has been defined to add any two accepted time. [10 marks]
Example:
Time A - 6 hours 35 minutes
Time B - 7 hours 45 minutes
Their sum is - 14 hours 20 minutes (where 60 minutes = 1 hour)
The details of the members of the class are given below:
Class name: Adder
Data member/instance variable:
a[]: integer array to hold two elements (hours and minutes)
Member functions/methods:
Adder(): constructor to assign 0 to the array elements
void readtime(): to enter the elements of the array
void addtime(Adder X, Adder Y): adds the time of the two parameterized objects X and Y and stores the sum in the current calling object
void disptime(): displays the array elements with an appropriate message (i.e., hours= and minutes=)
Specify the class Adder giving details of the constructor(), void readtime(), void addtime(Adder, Adder) and void disptime(). Define the main() function to create objects and call the functions accordingly to enable the task.
Answer:
import java.io.*;
class Adder {
int a[];
Adder() {
a = new int[2];
}
void readtime() throws IOException {
BufferedReader y = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter hour:");
a[0] = Integer.parseInt(y.readLine());
System.out.println("Enter minute:");
a[1] = Integer.parseInt(y.readLine());
}
void addtime(Adder X, Adder Y) {
int hour1 = X.a[0];
int min1 = X.a[1];
int hour2 = Y.a[0];
int min2 = Y.a[1];
int hourSum = hour1 + hour2;
int minSum = min1 + min2;
a[0] = hourSum + (minSum / 60);
a[1] = minSum % 60;
}
void disptime() {
System.out.println("Their sum is:");
System.out.println("hours = " + a[0] + " minutes = " + a[1]);
}
public static void main(String args[]) throws IOException {
Adder obj1 = new Adder();
Adder obj2 = new Adder();
Adder sumObj = new Adder();
obj1.readtime();
obj2.readtime();
sumObj.addtime(obj1, obj2);
sumObj.disptime();
}
}
Teacher's Note:
a) Ensure that minute overflow greater than 60 is correctly added to hours as \(\text{minSum} / 60\).
b) Verify object-oriented passing of Adder instances as parameters to the addtime method.
Question 9.
A class SwapSort has been defined to perform string related operations on a word input. Some of the members of the class are as follows: [10 marks]
Class name: SwapSort
Data members/instance variables:
wrd: to store a word
len: integer to store the length of the word
swapwrd: to store the swapped word
sortwrd: to store the sorted word
Member functions/methods:
SwapSort(): default constructor to initialize data members with legal initial values
void readword(): to accept a word in UPPER CASE
void swapchar(): to interchange/swap the first and last characters of the word in 'wrd' and stores the new word in 'swapwrd'
void sortword(): sorts the characters of the original word in alphabetical order and stores it in 'sortwrd'
void display(): displays the original word, swapped word and the sorted word
Specify the class SwapSort, giving the details of the constructor(), void readword(), void swapchar(), void sortword() and void display(). Define the main() function to create an object and call the functions accordingly to enable the task.
Answer:
import java.io.*;
public class SwapSort {
String wrd;
int len;
String swapwrd;
String sortwrd;
SwapSort() {
wrd = "";
len = 0;
swapwrd = "";
sortwrd = "";
}
void readword() throws IOException {
BufferedReader y = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter word:");
wrd = y.readLine().toUpperCase();
len = wrd.length();
}
void swapchar() {
if (len > 1) {
swapwrd = wrd.charAt(len - 1) + wrd.substring(1, len - 1) + wrd.charAt(0);
}
else {
swapwrd = wrd;
}
}
void sortword() {
char[] charArray = wrd.toCharArray();
int length = charArray.length;
for(int i = 0; i < length; i++) {
for(int j = i + 1; j < length; j++) {
if(charArray[j] < charArray[i]) {
char temp = charArray[i];
charArray[i] = charArray[j];
charArray[j] = temp;
}
}
}
sortwrd = new String(charArray);
}
void display() {
System.out.println("Original word : " + wrd);
System.out.println("Swapped word : " + swapwrd);
System.out.println("Sorted word : " + sortwrd);
}
public static void main(String args[]) throws IOException {
SwapSort obj = new SwapSort();
obj.readword();
obj.swapchar();
obj.sortword();
obj.display();
}
}
Teacher's Note:
a) String manipulation methods like substring and charAt are essential for character swapping.
b) Sorting character arrays using bubble sort or character comparison ensures alphabetical ordering.
SECTION - C
Answer any two questions.
Question 10.
A superclass Product has been defined to store the details of a product sold by a wholesaler to a retailer. Define a subclass Sales to compute the total amount paid by the retailer with or without fine along with service tax. [5 marks]
Some of the members of both classes are given below:
Class name: Product
Data members/instance variables:
name: stores the name of the product
code: integer to store the product code
amount: stores the total sale amount of the product (in decimals)
Member functions/methods:
Product(String n, int c, double p): parameterized constructor to assign data members: name = n, code = c and amount = p
void show(): displays the details of the data members
Class name: Sales
Data members/instance variables:
day: stores number of days taken to pay the sale amount
tax: to store the service tax (in decimals)
totamt: to store the total amount (in decimals)
Member functions/methods:
Sales(...): parameterized constructor to assign values to data members of both the classes
void compute(): calculates the service tax @ 12.4% of the actual sale amount, calculates the fine @ 2.5% of the actual sale amount only if the amount paid by the retailer to wholesaler exceeds 30 days, calculates the total amount paid by the retailer as (actual sale amount + service tax + fine)
void show(): displays the data members of the superclass and the total amount
Assume that the superclass Product has been defined. Using the concept of inheritance, specify the class Sales giving the details of the constructor(...), void compute() and void show(). The superclass, main function and algorithm need NOT be written.
Answer:
class Sales extends Product {
int day;
double tax;
double totamt;
double fine = 0.0;
Sales(String n, int c, double p, int d) {
super(n, c, p);
day = d;
}
void compute() {
tax = 12.4 * amount / 100.0;
if(day > 30) {
fine = 2.5 * amount / 100.0;
}
totamt = amount + tax + fine;
}
void show() {
super.show();
System.out.println("Total amount to be paid: " + totamt);
}
}
Teacher's Note:
a) Use the super keyword to invoke the parameterized constructor of the base class.
b) Check conditions for fine calculation when days exceed 30.
Question 11.
A queue is an entity which can hold a maximum of 100 integers. The queue enables the user to add integers from the rear and remove integers from the front. [5 marks]
Define a class Queue with the following details:
Class name: Queue
Data members/instance variables:
Que[]: array to hold the integer elements
size: stores the size of the array
front: to point the index of the front
rear: to point the index of the rear
Member functions:
Queue(int mm): constructor to initialize the data (size = mm, front = 0, rear = 0)
void addele(int v): to add integer from the rear if possible else display the message "Overflow"
int delele(): returns elements from front if present, otherwise displays the message "Underflow" and return -9999
void display(): displays the array elements
Specify the class Queue giving details of ONLY the functions void addele(int) and int delele()
Assume that the other functions have been defined.
The main function and algorithm need NOT be written.
Answer:
void addele(int v) {
if(rear == size - 1) {
System.out.println("Overflow");
}
else {
Que[++rear] = v;
}
}
int delele() {
if(front > rear) {
System.out.println("Underflow");
return -9999;
}
else {
return Que[front++];
}
}
Teacher's Note:
a) Proper boundary condition checks for queue overflow and underflow are crucial.
b) Note the index increments for linear queue operations.
Question 12.
(a) A linked list is formed from the objects of the class Node. The class structure of the Node is given below: [2 marks]
class Node
{
int num;
Node next;
}
Write an Algorithm OR a Method to count the nodes that contain only odd integers from an existing linked list and returns the count.
The method declaration is as follows:
int CountOdd (Node startPtr)
(b) Answer the following questions from the diagram of a Binary Tree given below: [3 marks]
[Figure: Binary tree with root M, left child N (having children W, Y and grandchild F under Y), right child G (having children Z, D and grandchild R under Z)]
(i) Write the postorder traversal of the above tree structure. [1 mark]
(ii) State the level numbers of the nodes N and R if the root is at 0 (zero) level. [1 mark]
(iii) List the internal nodes of the right sub-tree. [1 mark]
Answer:
(a)
int CountOdd(Node startPtr) {
int count = 0;
Node temp = startPtr;
while(temp != null) {
if(temp.num % 2 != 0) {
count++;
}
temp = temp.next;
}
return count;
}
(b)
(i) Postorder traversal: W -> F -> Y -> N -> R -> Z -> D -> G -> M
(ii) N is at level 1 and R is at level 3.
(iii) Internal nodes in right subtree = G, Z.
Teacher's Note:
a) Linked list traversal requires checking each node until null and verifying odd numbers using the modulus operator.
b) Postorder traversal visits Left subtree, Right subtree, and Root last.
Free study material for Computer Science
Past Exam Papers & Solutions for Class 12 Computer Science
Understanding Exam Patterns with ISC Class 12 Computer Science Board Exam Question Paper 2017 with Solutions
Explore downloadable past papers for Class 12 Computer Science. Utilizing the ISC Class 12 Computer Science Board Exam Question Paper 2017 with Solutions ensures complete preparedness by offering clear insights into historical question styles and marking expectations.
Why Practice Class 12 Computer Science Question Papers?
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.
Additional Study Resources for Class 12 Computer Science
Wrap up your exam preparation by reviewing detailed answer keys and tackling additional practice sets. All resources on our platform are free to access.
FAQs
The ISC Class 12 Computer Science Board Exam Question Paper 2017 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 2017 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 2017 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 2017 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 2017 with Solutions, are provided free of charge in mobile-friendly PDF.