title: time complexity by just looking at code
body: <p>Input n
  Repeat 
   n= n/2
  Until n&lt;= 1 </p>
  
  <p>i'm not sure whether this has a time complexity of O(n) or O(log n) since n is being halved in every iteration of the loop...</p>
  
  <p>I know that to calculate the time complexity you have to go through each operation and see how many times it will be executed with respect to the input, the part that confuses me is that since we are changing the value of the input with every iteration of the loop, what effect does that have on the total time complexity?</p>
  
  <p>any information about calculating time complexity of algorithms from just looking at code would be appreciated as i still don't quite have a hang of it...</p>