Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

How binary search work in java

OpenStudy (anonymous):

you mean the coding part?

OpenStudy (anonymous):

For binary search, for java or any language, you need to have the objects sorted in some sequence. In Java it will be easy if the objects are array items sorted on a key. After sorting, you start search. In a sequence, you compare your key with the middle key of the sorted array. If your search key is the middle key, then your job is done, otherwise, search either the left half or the right half of middle key, depending on the comparison result. Continue until you find the key(success), or the list can't be divided any more, in that case the search failed.

OpenStudy (anonymous):

java the coding and how is processs

OpenStudy (anonymous):

Andresfon12, try writing the code yourself, process is already explained.

OpenStudy (anonymous):

k

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!