made testing centralized for all algorithms; added binary search