Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BinarySearch{
- public BinarySearch(){
- }
- /**
- * Do binary search here
- * return - The index of where val is in words
- *
- **/
- public int search(String[] words, String val){
- }
- public static void main(String[] args){
- String[] words = {"a, b, c, d, e"};
- String val = "c";
- BinarySearch bs = new BinarySearch();
- if(bs.search(words, val) == >= 0){
- System.out.println("Word found");
- } else {
- System.out.println("Word not found");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement