title: Binary search with bubble sort
body: <p>Is it possible to have a binary search that uses a bubble sort to sort it?</p>
  
  <p>This is my bubble sort and binary search.  How do I combine them?</p>
  
  <pre><code>int Search_for_Client (int cList[], int low, int high, int target) {
      int middle;
      while (low &lt;= high) {
          middle = low + (high - low)/2;
          if (target &lt; cList[middle])
              high = middle - 1;
          else if (target &gt; cList[middle])
              low = middle + 1;
          else
              return middle;
      }
      return -1;
  }
  
  int bubbleSort(char cList[], int size) {
      int swapped;
      int p;
      for (p = 1; p &lt; size; p++) {
          swapped = 0;    /* this is to check if the array is already sorted */
          int j;
          for (j = 0; j &lt; size - p; j++) {
              if (cList[j] &gt; cList[j+1]) {
                  int temp = cList[j];
                  cList[j] = cList[j+1];
                  cList[j+1] = temp;
                  swapped = 1;
              }
          }
          if (!swapped)
          {
              break; /*if it is sorted then stop*/
          }
      }
  }
  </code></pre>