Hello Guys, i have a little logic problem in my program. The program is easy, has no real use and is for my learning only.
I try to implement a divideandconquer searchalgorithm inside an array.
For this purpose i am using a method who uses two parameters, a stringarray and the searchedname.

The problem:
If the searchedString is not the median ( array.length/2), it should look above or under the name in the array. I dont know how to implement this. The check if the value is more or less than the medianvalue works...but how do i implement that the method is using a "shorter part" of the array e.g. median+1 -> array.length for values greater than median or array[0]->median -1.

Here the method...i know the problem is very simple but it makes me mad that i am too stupid to udnerstand how it works.

Java Code:
public static int searchNameDivideConquer(String[] names,String searchedName){
	int median = names.length/2;
	int counter = 0; 
	if (names[median].equals(searchedName)){
		counter++;
		System.out.println("Name " + searchedName + " found!");
		return counter;
	}else {
		if (searchedName.compareTo(names[median]) >1){
               [COLOR="Red"]???[/COLOR]
	        counter ++;
                System.out.println("Name " + searchedName + " found!");
		}
		if (searchedName.compareTo(names[median])<1){
           [COLOR="Red"]     ???[/COLOR]
               counter ++;
		System.out.println("Name " + searchedName + " found!");
		}	
	}

	return counter;
	}
Help me!!!