about | help | code help+videos | done | prefs |
binarySearch_string
Given a String and a target letter, use the binary search algorithm to return the index where that letter appears in the String. Return -1 if the letter does not exist. Note: The String's letters are already sorted alphabetically and you must use binary search to receive credit for this problem. (Hint: Use the compareTo method for this problem!) binarySearch_string("first", "f") → 0 binarySearch_string("effort", "f") → 2 binarySearch_string("glory", "r") → 3 ...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