step 1 declare array k of size n ie kn is an


Step 1: Declare array 'k' of size 'n' i.e. k(n) is an array which stores all the keys of a file containing 'n' records

Step 2: i←0

Step 3: low←0, high←n-1

Step 4: while (low <= high)do

mid = (low + high)/2

if (key=k[mid]) then

write "record is at position", mid+1   //as the array starts from the 0th position

else

if(key < k[mid]) then

 high = mid - 1

else

low = mid + 1

 endif

endif

endwhile

Step 5: Write "Sorry, key value not found"

Step 6: Stop

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: step 1 declare array k of size n ie kn is an
Reference No:- TGS0264344

Expected delivery within 24 Hours