It probably would be a good idea to have a value for best already. The only issue with that would be what to set MIN_VALUE at, since what values look like could be different for any given problem. The suggestion to set it to some value in childArr should work out, since that's what will happen the first time through anyway.