title: Complexity: Conditional operator vs if-else
body: <p>I am working on a simple code algorithm with Java, and I am wondering there may be a difference between <code>? :</code> and <code>if-else</code> when calculating the time complexity. I think they both have the same time complexity, but I am not sure...</p>
  
  <p>For example:</p>
  
  <pre><code>if (number == num) {
      count += 1;
  }
  else {
      count -= 1;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>count += (number == num) ? 1 : -1;
  </code></pre>
  
  <p>Really thank you if you can tell me the difference between them :-)</p>