Space and Time Complexity Flashcards

1
Q

What are some ways to determine the efficiency of algorithms?

A

Their space and time complexity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain time complexity and when is an algorithm said to be efficient with respect to time.

A

Time complexity is how fast an algorithm executes all its instructions. When dealing with time complexity an algorithm is said to be efficient if it executes all its instructions within the minimum or shortest time possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is space complexity and when is an algorithm said to be efficient in regards to space complexity?

A

Space complexity is the amount of RAM space or memory an algorithm uses to execute all its instructions. An algorithm is said to be efficient with regard to space complexity if said algorithm uses the least amount of possible RAM space or memory to execute all its instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are asymptotic notation and asymptotic analysis?

A

They are a method or way of analyzing the efficiency of algorithms, by analyzing the behavior of algorithms as their input increases or approaches infinity.
-> Asymptotic notation is a mathematical notation used for asymptotic analysis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the best, average, and worst-case scenarios of an algorithm.

A

-> Best Case: It is the minimum time an algorithm takes to execute all its instructions.
-> Average Case: It is the typical or average time an algorithm will take to execute all its instructions.
-> Worst Case: it is the maximum time an algorithm will take to execute all its instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State and explain the notations used to calculate the time complexity of algorithms.

A

-> Big O:
This is a mathematical notation used to calculate the
time it will take for an algorithm to execute as its
input increases, it calculates the worst-case scenario
an algorithm.
-> Omega:
It is a mathematical notation that measures the
the best-case time complexity of an algorithm.
-> Theta:
This mathematical notation calculates both the best
and worst-case time complexity of an algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly