about | help | code help+videos | done | prefs |
Given an integer array and a target value, use the binary search algorithm looking for the value, but instead of returning the value's index or -1, return the number of elements you had to access! Note: The integer array is already sorted from least to greatest and you must use binary search to receive credit for this problem. binarySearch_access([1, 3, 5], 1) → 2 binarySearch_access([1, 3, 5], 3) → 1 binarySearch_access([1, 3, 5], 5) → 2 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy