can some 1 help me with this????
an array is made of random numbers and then sorted. ask the user to enter a number i.e.4. the search will start
would a binary alogrithm look like this:?
choose a mid point = midpoint=numberofitems / 2
if it matches the searched the value then stop
if it is more than search item then pick a new mid point to the left of the current mid point
if it is less than search item then pick a new mid point to the right of the current mid point
keep repeating until the search value is found.
some one there who can help me with this????
an array is made of random numbers and then sorted. ask the user to enter a number i.e.4. the search will start
would a binary alogrithm look like this:?
choose a mid point = midpoint=numberofitems / 2
if it matches the searched the value then stop
if it is more than search item then pick a new mid point to the left of the current mid point
if it is less than search item then pick a new mid point to the right of the current mid point
keep repeating until the search value is found.
some one there who can help me with this????