title: Two Element Sum Search for unsorted array
body: <p>I was going through Introduction to algorithm, where I came across ex 2.3-7.</p>
  <p>after much thought on it, I realised that the brute force algorithm takes O(nlogn):</p>
  <pre><code>bool exactSum(int arr[], const int &amp;length, const int &amp;value) {
    bool isExact = false;
    for(unsigned i = 0; i &lt; length - 1; ++i) {
      for(unsigned j = i + 1; j &lt; length; ++j) {
        if(arr[i] + arr[j] == value) {
           isExact = true;
           break;
        }
      }
    }
  
    return isExact;
  }
  </code></pre>
  <p>you see, there are only nlogn checks. am I wrong?</p>