The complexity of an algorithm computes the amount of time and spaces required by an algorithm for an input of size (n).
The complexity of an algorithm can be divided into two types.
The time complexity and the space complexity.
Two factors which determine the complexity of an algorithm :1 Time Complexity :The amount of computer time algorithm needs to run to completion. 2 Space Complexity :The amount of memory algorithm needs to run to completion.
Algorithms with running time O(2^N) are often recursive algorithms that solve a problem of size N by recursively solving two smaller problems of size N-1.