Hi guys, I want to verify why when I have 1+2+3+4+5+...+n I can't write like this Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)+Θ (1)... = n*Θ (1) ?! we already know that any constant can be converted to Θ (1) !
another question, if i=4 till i<16 {i=i*4} then it will make 4 iterations because 4*4=16 but why if i=16 i>4{i=i/4} then it's the same number of iterations? it doesn't make a sense for me..any help please?
Another issue, lets suppose given T(n)=T(n/4)+C , why it's wrong to say like this:
T(n)=T(n/4)+c=T((1/2)*n/2) +c= T(n/2)+c (neglecting the constant (1/2) because O(n/4)=O((1/2)*n/2)=O(n/2) so (1/2) is absorbed by O() )?
thanks for helpers
another question, if i=4 till i<16 {i=i*4} then it will make 4 iterations because 4*4=16 but why if i=16 i>4{i=i/4} then it's the same number of iterations? it doesn't make a sense for me..any help please?
Another issue, lets suppose given T(n)=T(n/4)+C , why it's wrong to say like this:
T(n)=T(n/4)+c=T((1/2)*n/2) +c= T(n/2)+c (neglecting the constant (1/2) because O(n/4)=O((1/2)*n/2)=O(n/2) so (1/2) is absorbed by O() )?
thanks for helpers
Last edited: