# pset3(count sort):can't sort using count sort,it doesn't sort at all or not returning the sorted array??plz help

``````/**
* helpers.c
*
* Helper functions for Problem Set 3.
*/

#include <cs50.h>

#include "helpers.h"

#define bound 200
/**
* Returns true if value is in array of n values, else false.
*/
bool search(int value, int values[], int n)
{
int start=0;
int end=n-1;
while(start<=end)
{
int middle=(start+end) /2;

if(value==values[middle])
{
return true;
}
else if(value<values[middle])
{
end=middle-1;
}
else if(value>values[middle])
{
start=middle+1;
}
}
return false;
}

/**
* Sorts array of n values.
*/
void sort(int values[], int n)
{
int temp[bound+1]={0};
//for(int i=0;i<bound+1;i++)
//  temp[i]=0;
for(int i=0;i<n;i++)
{
int value=values[i];
temp[value]++;
}
for(int i=0;i<bound+1;i++)
{
int no=temp[i];
for(int j=0;j<no;j++)
{
values[j]=i;
}
}
//return;
}
``````
• What is bound? What are the contents of bound? Please add related code to question. – Cliff B Sep 4 '17 at 0:19