Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I thought so because when I went to each recursive call I work only on half of the previous one, so the height of the call tree should be $ \log_2 (n) $ and the complexity $ \sum_ {i = 1} ^ {\log_2 (n)} costwhile = \sum_ {i = 1} ^ {\log_2 (n)} \theta (1) = \theta (\log_2 (n)) $. do I have to think differently?