How to decide parameters so as to cover all the possible test cases

int binrySrch( int key,int list[], int length){

int e = length-1, s = 0;

int pointer = INT_MAX  ;

while( s<=e){

	int mid = (s+e)/2;

	if (key >list[(s+e)/2]){

		s = mid+1;


	}

	else if ( key < list[mid]){

		e = mid-1;
	}

	else if( key == list[mid]){


		pointer = mid;
		break;
	}

	for( int i = s; i<=e;i++){

		cout<<list[i]<<',';
	}
	
	cout<<endl;
	
}
return pointer;
}

vs

int binrySrch( int key,int list[], int length){

int e = length-1, s = 0;

int pointer = INT_MAX  ;

while( s<=e){

	int mid = (s+e)/2;

	if (key >list[(s+e)/2]){

		s = mid;  # doubt


	}

	else if ( key < list[mid]){

		e = mid;
	}

	else if( key == list[mid]){


		pointer = mid;
		break;
	}

	for( int i = s; i<=e;i++){

		cout<<list[i]<<',';
	}
	
	cout<<endl;
	
}
return pointer;
}

now i wish to check for test cases, where i should check so as to understand where the second code is not working and creating problem where as working fine for the first one

@snatchit

You can see the test cases here https://hack.codingblocks.com/app/contests/1341/561/problem

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.