Idea Of Efficiency Class 12 Computer Science Important Questions

Students can read the important questions given below for Idea Of Efficiency Class 12 Computer Science. All Idea Of Efficiency Class 12 Notes and questions with solutions have been prepared based on the latest syllabus and examination guidelines issued by CBSE, NCERT and KVS. You should read all notes provided by us and Class 12 Computer Science Important Questions provided for all chapters to get better marks in examinations. Computer Science Question Bank Class 12 is available on our website for free download in PDF.

Important Questions of Idea Of Efficiency Class 12

Very Short Answer Type Questions :

Question: Which factors affect an algorithm’s performance?

Question: Which complexity is more O(n) or O(log n)?

Question: What is algorithm?
Answer: It is a step by step process to solve a problem.

Question: What is the best case in terms of algorithms?
Answer: The input that makes a given algorithm run fastest.

Question: What is Algorithm efficiency?
Answer: Algorithm efficiency is related to the time taken by a program for execution and space used by the algorithm.

Question: Is linear search or binary search faster?

Question: What is worst case in terms of algorithms?
Answer: The input that makes a given algorithm run slowest.

Question: Define Big ‘O’ notation.
Answer: It is the upper bound of an algorithm’s performance i.e. if we say an algorithm takes O(n2) time: this means that this algorithm will carry out its task taking at most n2 steps for input size n.

Question: Name the External Factors that affects algorithm’s efficiency.
Answer: External Factors affecting algorithm efficiency are:

• Size of the input to the algorithm
• Speed of the computer on which it is run
• Quality of the compiler

Question: What is the time complexity of binary search?
O(log n)

Question: Determine the complexity:
a)
n=int(input(“Enter the number to check”))
flag=0
for i in range(2,n):
if n%i==0:
flag=1
break
if flag:
print(n,”is Not a prime number”)
else:
print(n,” is prime number”)
b)
n=int(input(“Enter the number to check”))
flag=1
i=2
while(i*i<=n):
if n%i==0:
flag=0
break
i=i+1
if flag:
print(n,”is Not a prime number”)
else:
print(n,” is prime number”)
c)
for i in range(n):
a=i+i+2
print(a)
for j in range(m):
b=b*4
print(b)
d)
for i in range(n):
for j in range(n):
a=i+j
print(a)
for k in range(n):
print(k)

Question: Reorder the following efficiencies from smallest to largest:
a)10000 b)n! c) n2 d)nlogn

Question: Given the following array, which search will find the value 18 in least steps?
3 10 18 22 35

Question: a)What is the worst case complexity of the following code fragment?
for x in range(a):
statements
for y in range(b):
for z in range( c) :
statements
b) How would the complexity would change if a,b,c are replaced by n?

Question: Given the following array, which search will find the value 3 in least steps?
3 10 18 22 35

Question: Calculate the run-time efficiency of the following program segment:
i=1
while i<=n:
while j<=n:
k=1
while k<=n:
print(i,j,k)
k=k+1
j=j+1
i=i+1