veena bijur wrote:
in the above list, element "B" not there so i want to display element not found, how to do that?
in the above code if element doesnt exist it displays run-time error, how to catch that error.
Have you read the documentation for binarySearch and what happens if the element sought is not found?veena bijur wrote: . . .
veena bijur wrote:
else: (-(insertion point) - 1). could you please explain the else part.
veena bijur wrote:
i did not get the below line
(-(insertion point) - 1)
veena bijur wrote:
i did not get the below line
(-(insertion point) - 1)
Jeff Verdegan wrote:Have you tried just calling the binarySearch() method for various values that are present and not present, and looking at the results? If you do that, and re-read the docs, it should be blatantly obvious what's going on.
Jeff Verdegan wrote:Have you tried just calling the binarySearch() method for various values that are present and not present, and looking at the results? If you do that, and re-read the docs, it should be blatantly obvious what's going on.
Henry Wong wrote:
Jeff Verdegan wrote:Have you tried just calling the binarySearch() method for various values that are present and not present, and looking at the results? If you do that, and re-read the docs, it should be blatantly obvious what's going on.
Jeff,
Perhaps the OP is not a native english speaker? The documentation may sound straightforward to you and I, but I am sure that there are idioms (or experience related stuff) that makes it difficult to understand.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |