What will be the time Complexity of rat in maze by only using backtracking?

RE: T(n,m) = T(n-1,m) + T(n,m-1)

According to me:

Let size of maze be n x m. Then for each grid we will traverse n x m to check the path .
Therefore T(n,m) =O(n x n x m x m)

I tried it using BFS and DFS where T(n,m) is O( n x m )

Please explain and correct me .
Also How To solve that recursive Equation

@saswat1908
Yes your analysis of TC is right
For further analysis you can see this link https://www.quora.com/What-is-the-average-case-time-complexity-of-a-backtracking-maze-solver

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.