Choose the correct option.
for (int i = 0; i < p; i++)
{
a += Math.sqrt(i);
}
for (int j = 0; j < q; j++)
{
b += Math.log(j + 1);
}- (a)$O(1)$
- (b)$O(p \times q)$
- (c)$O(p^2 + q^2)$
- (d)$O(p + q)$
Show answer
Answer
Correct option: (d)
16 past-paper questions on Complexity and Big O notation from ISC Class 12 Computer Science papers (2026-2017), newest first, in full. Tap "Show answer" under a question to see its answer. The syllabus covers Computational complexity, Input size, Dominant terms and constants, Best, average and worst case and Big O notation.
Nothing matches. Try fewer letters.
Choose the correct option.
for (int i = 0; i < p; i++)
{
a += Math.sqrt(i);
}
for (int j = 0; j < q; j++)
{
b += Math.log(j + 1);
}Answer
Correct option: (d)
Choose the correct option.
for(int i=1; i<= n; i++)
{
for(int j=1; j<= i; j++)
{
statement;
}
}Answer
Correct option: (d)
Answer the following.
Answer
Official answer keyAnswer the following.
for ( int i=1; i<=P; i++)
{ Statements }
for (int j=1; j<=P; ++j)
for (int k=1; k<=Q; k++)
{ Statements }Answer
Answer the following question.
Answer
Answer the following question.
double m = 1, n = 1;
for (int i = 0; i < x; i++)
{
m *= Math.random( );
}
for (int j = 0; j < y; j++)
{
n *= Math.random( );
}Answer
Answer the following.
int i=1, j=1, k=1, p;
while (i <= p)
{
statements
}
while (j <= p)
{
while (k <= p)
{
statements
}
}Answer
Answer the following question.
void displayMessage( )
{
System.out.println("Hello World");
System.out.println("Hello World");
System.out.println("Hello World");
System.out.println("Hello World");
}The student modified the code later to reduce the number of lines in the code. void displayMessage( )
{
int i = 1;
while(i <= 4)
{
System.out.println("Hello World");
i++;
}
}Compare the above code snippets with respect to the time complexity.Answer
Answer the following.
Answer
Answer the following.
Answer
Answer the following in short.
Answer
Answer the following in short.
Answer
Differentiate between the following.
Answer
Answer the following.
Answer
Answer the following question.
for (int x = 1; x <= a; x++)
{
statements;
}
for (int y = 1; y <= b; y++)
{
for (int z = 1; z <= c; z++)
{
statements;
}
}Answer
Answer the following question.
Answer
Complexity and Big O notation is a unit of the ISC Class 12 Computer Science syllabus.
The syllabus lists these topics: Computational complexity, Input size, Dominant terms and constants, Best, average and worst case and Big O notation.
Prashnika has 16 past-paper questions on Complexity and Big O notation, from papers of 2017-2026, asked in 7 different years. By kind: Short answer (13), MCQ (2) and Differentiate (1). They carry between 1 and 2 marks, and most are worth 1 mark.
To practise, use the paper generator, which can build a practice paper from this chapter.
The syllabus lists Computational complexity, Input size, Dominant terms and constants, Best, average and worst case and Big O notation.
Prashnika has 16 questions on Complexity and Big O notation, from papers of 2017-2026 (board, specimen, improvement and practice papers together).
By kind: Short answer (13), MCQ (2) and Differentiate (1).