🌲 Recursion Tree
0
Total Calls
0
Tree Depth
0
Input N
-
Time Complexity
📜 Call Stack
📚 Execution Order
📚 Understanding Recursion Complexity
The complexity of a recursive function depends on:
- T(n) = T(n-1) + O(1): Linear recursion → O(N)
- T(n) = T(n/2) + O(1): Halving recursion → O(log N)
- T(n) = 2T(n/2) + O(1): Binary tree → O(N)
- T(n) = 2T(n-1) + O(1): Exponential → O(2^N)
- T(n) = 2T(n/2) + O(N): Merge sort pattern → O(N log N)