Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Search in a Rotated Array

class Solution{

    public:

    int search(int A[], int l, int h, int key){

    //complete the function here

    for(int i=0;i<h+1;i++)

    {

        if(A[i]==key)

        {

            return i;

        }

    }

    return -1;

   

    }

}.
Source by practice.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Search #Rotated #Array
ADD COMMENT
Topic
Name
4+3 =