0

how can i prove that T(n)=T(n-2)+T(n-3)+T(n-4)+2 is O(logn)? or T(n)=T(n-1)+T(n-3)+1 the same.. when T(0)=1 T(1)=2 T(2)=3 T(3)=5 T(4)=8 etc`..

it's a Q about AVL-2 tree,the same rules of AVL tree who rotate after 3 levels diff between L,R childs.. and not 2 as AVL tree

thanks for all.

Rick Decker
  • 14,826
  • 5
  • 42
  • 54
  • For both, look, for example, at the first ten values. There's no way these grow as slowly as $\log n$. Even if, say, we replaced the first by just $T(n)=T(n-2)+2$ we'd have $T(n)=\Theta(n)$. – Rick Decker May 24 '16 at 23:44
  • Are you sure that solves to $O(\log n)$? That doesn't sound right. You might want to look at the annihilator method for solving linear recurrences; it probably will work here. – templatetypedef May 25 '16 at 00:04
  • well.. thank for all... the ans is T(n)=T(n-1)+T(n-3)+1<=T(n)=T(n-3)+T(n-3)+1 – user51677 May 26 '16 at 23:53
  • well.. thank for all... the ans is T(n)=T(n-1)+T(n-3)+1≤T(n)=T(n-3)+T(n-3)+1 T(n)=T(n-3)+T(n-3)+1=T(n)=2T(n-3)+1 T(n-3)=2T(n-6)+1=> T(n)=2[2T(n-6)+1]+1 T(n-6)=2T(n-9)+1=>T(n)=22[2T(n-9)+1]+1+1 ..... T(o)=2(2(2(2(...2(2*1+1)+1)+1)+1)+1)...+1) T(0)≤2^(n/3).. :? – user51677 May 27 '16 at 00:16

0 Answers0