Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cautare binara in vector sortat
- li=0;
- lf=n-1;
- ok=0;
- while (li<=lf && ok==0)
- {
- int mij=(li+lf)/2;
- if(v[mij]==k) (val cautata)
- ok=1;
- else
- if(k<v[mij])
- lf=mij-1;
- else
- li=mij+1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement