logo

Crowdly

Browser

Add to Chrome

Який алгоритм пошуку реалізовано у коді? int search(int A[], int first, int l...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Який алгоритм пошуку реалізовано у коді?

int search(int

A[],

int

first,

int

last, int

key)

{

  if

(last<first) return

-1;

  int

mid =

(first

+ last)

/

2;  

  if

(key==A[mid])

  return mid;  

  else 

     if

(key<A[mid])

 return search(A,

first,

mid –

1,

key);  

     else  

return search(A,

mid +

1,

last,

key);

}

More questions like this

Want instant access to all verified answers on cyber.onua.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome