Binary search. Given a sorted set of 1000 random integers, devise and program a binary search for a randomly generated target between -999 999 and 999 999 inclusive, and report both the location of the target within the set (or that the target was not found) and the number of steps required to locate the target (or to determine that the target does not appear). Create a utility method,
populateArray(String fileName), to load the data.
[This page last updated 2020-12-23 at 12h12 Toronto local time.]
© 2007–2021 Hersch, Bear & Company Limited. All rights reserved. “Grammar Authority,” “grammarauthority.com,” “touque.ca,” and “Canada’s Thinking Cap” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners.