Fatorial using stack have space complexity O(n),, and if it is not O(n) then please explain shortly

whatevere stack formed in recursion takes memory ,whu=ich is built in heap memory…IF IT IS NOt then please explain briefly,…

@AMIT_KUMAR
hello Amit,
if u are using recusion,then it will use system stack so yes will takes some memory on stack not heap.

read about stack and heap memory.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.