What is the complexity of an algorithm? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the complexity of an algorithm?

What is the space time tradeoff of algorithms?

15th Feb 2019, 5:03 PM
AKS
AKS - avatar
2 Answers
+ 2
Complexity is basically the amount of space and time required by a program while execution . It is of two types: a) time complexity : time required by code while execution. b) space complexity: memory required by code while execution . Space time tradeoff: whenever we try to improve our time complexity (making it less time or more faster) we will increase space complexity and vice versa. In other words , we can say that it has an inverse relationship. We will have to compromise with one while improving another .Deciding factor depends upon the application requirements. Hope it helps
15th Feb 2019, 5:20 PM
shalini jha
shalini jha - avatar