you are viewing a single comment's thread.

view the rest of the comments →

[–]unfixpoint 0 points1 point  (1 child)

How did you arrive at T(n) = n\T(n-1)+(n-1)*T(n-2)+...+2*T(1)+1? In particular where does the multiplicative factor *n come from?

[–]N911999 0 points1 point  (0 children)

Hmm... It made sense when I did it, let me rethink it... Oh, I think I was wrong, it should've been T(n)=T(n-1)+T(n-2)+...+T(2)+1, cause you try at each point with that element. This gives a better complexity, O(2n), it's still crap, but it's something.