what is the time and space complexity of balanced bracket probelm ? i am not able to compute it
Time and space complexity?
It is of the order 4^n
how please explain and what about space complexity?
Sorry , its 2^n because For every index there can be two options ‘{‘ or ‘}’. So it can be said that the upperbound of time complexity is O(2^n) or it has exponential time complexity.