low = 0;
high = n-1;
while (low<=high)
{midle = (low+high)/2;
if (key == data [middle])
return (middle); //selesai
if (key<data[middle])
high = middle-1;
else
low = middle +1;
}
return(-1); //data tidak di temukan
Senin, 23 April 2012
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar