I am using an recursive linear search algortihm. even the if condition is true it always returns null. If I don't put null it gives an error. I could not just figure out that how can I made proper. Thanks for help
private String findMinimumPricedHelper(String name, IMedia[] treeArray, int index) {
if (some conditions)
return treeArray[index].toString();
else
findMinimumPricedHelper(name, treeArray, index+1);
return null;
}
I was expecting a value treeArray[index].toString() but it returns null