Will the Time and space complexity for both top-down and bottom-up will be O(n^2)?
Also which will be better in this case top down or bottom up?
Time and space complexity
In terms of complexity, both are technically the same, both take O(N^2)
you can use either approach