HW1 3 - l b t canthenbe added ut this doesn'thaveto...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
can then be added, but this doesn't have to behave like an "undo" operation that would put back duplicates that you previously removed. You are required to use the built-in Anays.binarySearch method discussed in section for all of your location testing (Where is a value? Where would I insert a new value?). You can find the documentation for it in the JavaAPI documentation that is the first link under "useful links" on the class web page. Keep in mind that because this is a static method, you have to use the class name in calling it. For example, to find the location of the value 42 in an array called data when we want to explore the first twelve elements, you'd say something like: int index : Arrays.binarySearch(data, 0, 12, 421; Remember that the "from index"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online