Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int busqueda (int arreglo[], int n, int dato)
- {
- int medio, info=0, arriba=n-1;
- while(info<=arriba)
- {
- medio=(info+arriba)/2;
- if(arreglo[medio]==dato)
- {
- return medio;
- }
- else if(dato<arreglo[medio])
- {
- arriba=medio-1;
- }
- else
- {
- info=medio+1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement