function quadrant($x,$y) {
if( $x >= 0 && $y >= 0 )
$result = "point ($x,$y) lies in the First quandrant";
else if( $x < 0 && $y >= 0)
$result = "point ($x,$y) lies in the Second quandrant";
else if( $x < 0 && $y < 0)
$result = "point ($x,$y) lies in the Third quandrant";
else if( $x >= 0 && $y < 0)
$result = "point ($x,$y) lies in the Fourth quandrant";
return $result;
}
$x=1;
$y=1;
$q = quadrant($x,$y);
what is the value of $x or $y that is the worst case in terms of performance? and how many comparisons are made?
what is the value of $x or $y that is the best case in terms of performance? and how many comparisons are made?