Question: Q1. Fill in the Blanks 1. In space complexity, ______________________ space is required to store the executable version of the program. (Instruction, data). 2. In

Q1. Fill in the Blanks

1. In space complexity, ______________________ space is required to store the executable version of the program. (Instruction, data).

2. In space complexity, _______________ space is required to store all the constants and variables including temporary variables value. (Data , Instruction )

3. In space complexity, ________________ space required to store the environment information needed to resume the suspended function. (Environment, Instruction)

4. In Time Complexity, O(expression) represents the _______________ of an algorithm's time complexity. (worst case , Best case)

5. In Time Complexity, Omega(expression) represents the _______________ of an algorithm's time complexity. (best case, worst case)

6. In Time Complexity, Theta(expression) represents the ________________ of an algorithm's time complexity. (average case , Best case)

7. The study of change in performance of the algorithm with the change in the order of the input size is defined as ________________ analysis. (asymptotic , system)

8. In bubble sort, when the input array is already sorted, the time taken by the algorithm is linear. This is an example of __________ case condition. (Best , worst).

9. When the input array is in reverse condition, the algorithm takes the maximum time (quadratic) to sort the elements. This is an example of __________ case condition. (worst , best).

10. ________________________encloses the function from above and below. Since, it represents the upper and the lower bound of the running time of an algorithm, it is used for analyzing the average case complexity of an algorithm. (Theta notation , Big-O notation).

11. __________________________represents the upper bound of the running time of an algorithm. Thus, it gives the worst case complexity of an algorithm. (Big-O notation , Theta notation)

12. _________________________represents the lower bound of the running time of an algorithm. Thus, it provides best case complexity of an algorithm. ( Omega notation , Big-O notation)

13. ________________ Algorithms are designed to achieve optimum solution for a given problem. In this algorithm approach, decisions are made from the given solution domain. (Greedy , Divide & Conquer)

14. Generally, optimization problem, or the problem where we have to find maximum or minimum of something or we have to find some optimal solution, _____________________technique is used. (Greedy , Divide & Conquer)

15. ___________________ Technique is best suited for applications where: Solution is required in real-time and Approximate solution is sufficient. (Greedy , Divide & Conquer)

Q2. True or False

1. Time Complexity is a way to represent the amount of time required by the program to run till its completion.

2. Data structures are used to hold data while algorithms are used to solve the problem using that data.

3. Algorithm is a set of well defined instructions in sequence to solve the problem.

4. The time taken by the computer to run a code is calculated by the formula -> Time to run code = number of instructions * time to execute each instruction

5. If you don't know algorithms well, you won't be able to identify if you can optimize the code you are writing right now.

6. Algorithms are generally created dependent of underlying languages, i.e. an algorithm cannot be implemented in more than one programming language.

7. We design an algorithm to get a solution of a given problem, Hence, many solution algorithms can be derived for a given problem.

8. In Time Factor Time is measured by counting the maximum memory space required by the algorithm.

9. In Space Factor - Space is measured by counting the number of key operations such as comparisons in the sorting algorithm.

10. In Space complexity, a variable part is a space required by variables, whose size depends on the size of the problem.

11. In Space complexity, a fixed part that is a space required to store certain data and variables ,that are independent of the size of the problem.

12. Time complexity of an algorithm represents the amount of time required by the algorithm to run to completion.

13. For calculating the space complexity, we need to know the value of memory used by different type of data type variables.

14. The time complexity of algorithms is most commonly expressed using the big O notation. It's an asymptotic notation to represent the time complexity.

15. The greedy algorithm has multiple chances to compute the optimal solution and thus, can go back multiple times and look at other alternate solutions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!