Space and time complexity?

please tell the space and time complexity of the problem build ballanced tree from array?

@namangarg31, the space complexity would be o(logn ) and the time complexity will be o(n)
for space complexity , the height of function stack will never be more than the height of the tree and for the height balance tree the height is logn , and for time complexity , since we are accessing every array elements only once so for n elements n access will be done resulting in o(n) time complexity

sir, i got confused whenever there are more than one recursive calls in single recursive function.Like in fibbonacci function using recursion .Sometimes it is O(2^n) when two recursive calls are made sometimes it is O(n), so please explain me i am bit confused.

@namangarg31, try to make a tree like structure like write down all the states and represent every function call as an edge of a tree this will provide a good visual representation of the change in recursive state, also there is something called as master’s method which will provide you a formula to compute time complexity for recursive questions,
practice some question on time complexity for better understanding

.