Question: Use binary search int binarySearch(char* arr[], char* x, int n) main and function use char* Given a sorted array of String and a String x,
![Use binary search int binarySearch(char* arr[], char* x, int n) main](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2e852b5c93_21866f2e85265b60.jpg)
Use binary search
int binarySearch(char* arr[], char* x, int n)
main and function use char*
Given a sorted array of String and a String x, find index of x if it is present in the array using binary search Input : arr[] -{ "contribute", "geeks", "ide", "practice"), x- "ide" Output2 The String x is present at index 2. Input arrcontribute", "geeks", "ide", "practice"], x "zz" Output -1 The String "zz" is not present
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
