Section A
Space complexity is amount of memory required by an algorithm to execute and get the result.
Time complexity is the amount time required to finish execution of an algorithm and get the result.
2. It is important because the algorithm performance is evaluated in terms of input size allowing to
estimate the performance levels with increase in the inputs by looking closely with how much space
and time it takes to execute.
3. allows us to predict how algorithms will will perform in real life scenarios
Allows us to compare and choose the suitable algorithm from a different algorithm when solving a
particular problem.
Section B
1. Best case performance is used to describe an algorithms performance under favourable
conditions where the algorithms takes minimal time and memory to solve a problem while
worst case performance describes an algorithms performance under unfavourable conditions
where the algorithm takes a lot of time and memory to solve a problem.
2. Understanding the worst case performance is crucial in life because it enables us to
understand the potential challenges that need to be addressed before hand.
3. a- O (1) stands for Constant time function/method that describes that an algorithm takes the
same amount of time to execute regardless of the size of inputs
- O(n) stands for Linear time function/ method that describes that time taken to execute
an algorithm depends on the size of the inputs.
c. in a linear time function, space complexity is describes that the space required to solve the
problem grows in relation to the size of the inputs.