/**************************************************************************** * helpers.c * * Computer Science 50 * Problem Set 3 * * Helper functions for Problem Set 3. ***************************************************************************/ #include #include "helpers.h" /* * Returns true if value is in array of n values, else false. */ bool search(int value, int array[], int n) { // TODO: re-implement as binary search for (int i = 0; i < n; i++) if (array[i] == value) return true; return false; } /* * Sorts array of n values. */ void sort(int values[], int n) { // TODO: implement an O(n^2) sort return; }