# Idea of Algorithm Efficiency in Python Class 12 Solutions

Teachers and Examiners (CBSESkillEduction) collaborated to create the Idea of Algorithm Efficiency in Python Class 12 Solutions. All the important Information are taken from the NCERT Textbook Computer Science (083) class 12.

Contents

## Idea of Algorithm Efficiency in Python Class 12 Solutions

1. An ___________ is a sufficiently precise method or procedur for accomplishing a specific tast, which can be programmed on computer.
a. Algorithm
b. Complexity
c. Big-O
d. None of the above

a. Algorithm

2. ________ referes to the measure of the performace of an algorithm.
a. Algorithm
b. Complexity
c. Big-O
d. None of the above

b. Complexity

3. __________ can be related to time (temporal complexity) or to space (space complexity).
a. Algorithm
b. Complexity
c. Big-O
d. None of the abve

b. Complexity

4. ________ notation is used to depict an algorithm’s growth rate i.e. change in algorithm performance when its input size grows.
a. Algorithm
b. Complexity
c. Big-O
d. None of the abve

c. Big-O

5. __________ term is the one which affects the most, an algorithm’s performance.
a. Algorithm
b. Complexity
c. Big-O
d. Dominant

d. Dominant

6. Only the ________ term is inclued in Big-O notation.
a. Algorithm
b. Complexity
c. Big-O
d. Dominant

d. Dominant

7. The Worst case complexity provides an _________ on running time.
a. Upper-bound
b. Lower-bound
c. Middle-bound
d. All of the above

a. Upper-bound

8. ___________ complexity provieds expected running time.
a. Algorithm
b. Complexity
c. Best-Case
d. Average-Case

d. Average-Case

9. _________ complxity provides the time of optimal performace.
a. Algorithm
b. Complexity
c. Best-Case
d. Average-Case

c. Best-Case

10. Define Big ‘O’ notation. State the two factors which determine the complexity of an algorithm.
Answer – Big O notation, which provides the measurement of the time while an algorithm operates with the worst input it can receive, typically specifies the worst case complexity. The two factors that affect an algorithm’s complexity are time and space.

11. Distinguish between worst-case and best-case complexity of an algorithm.
Answer – The function with the fewest steps taken on input data with n elements is the best case. The worst-case scenario is the function that goes through the most steps with input data of size n. The function that goes through the most steps on input data with n elements is called the average case.

12. What is an algorithm? What do you understand by alogrithm performance?
Answer – A set of instructions called an algorithm is what a computer must follow in order to conduct calculations or other problem-solving tasks. A formal definition of an algorithm is that it is a finite set of instructions that are carried out in a particular order to complete a specified task.

13. What is computationl complexity?
Answer – The task is to determine how many times each letter appears in an N-letter string. The entire string is iterated over by a crude algorithm once for each potential letter. The procedure is linear in N since the size of the alphabet is fixed

14. Is linear search or binary search faster?
Answer – When compared to a linear search, a binary search is faster in finding an element. In contrast to linear search, which works with both sorted and unsorted arrays, binary search just requires that an array be in sorted order.

15. Which factors affect an algorithm’s performance?
Answer – One of the most important factors in assessing an algorithm’s potential is speed. The effectiveness of an algorithm is also affected by other elements including usability, security, maintainability, and utilisation space. Complexity measures for space and time are used to assess parameters.

16. Which complexity is more O(n) or O(log n)?
Answer – An algorithm of O(n) will execute steps proportional to n for an input of size n, while an algorithm of O(log(n)) will execute steps roughly log(n). Since log(n) is obviously smaller than n, an algorithm with an O(log(n)) complexity is preferable.

17. What are different types of complexities that are considered?
Answer – The complexity can take on any shape, including linear, n*log(n), quadratic, cubic, exponential, and more. It is nothing more than the number of steps necessary to complete a specific algorithm, whether they are constant, logarithmic, linear, or another type.

18. What do you understand by Big-O notation? What is its significance?
Answer – Big O Notation is a technique for expressing how time-consuming an algorithm is. As the input increases, it calculates how long it will take to perform an algorithm. In other words, it determines an algorithm’s worst-case time complexity. The maximum runtime of an algorithm is expressed using the Big O Notation in data structures.

19. What do you understand by best-case, worst-case and average-case complexitites? When are they considered?
Answer – The function with the fewest steps taken on input data with n elements is the best case. The worst-case scenario is the function that goes through the most steps with input data of size n. The function that goes through the most steps on input data with n elements is called the average case.

Computer Science Class 12 Notes

MCQ for Class 12 Computer Science Python

Computer Science Class 12 Questions and Answers