Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

Answer Posted / aniruddha

public int check(int a[], int b[])
{  int value,w;
   for(int i=0; i<=a.length; i++)
   {  w=0;
      for(int j=0; j<b.length; j++)
      {  
         if(a[i]!=b[j])
         {  w++;
            break;
         }
      }
      if(w==0)
      value=a[i];
   }
   return value;
}

Is This Answer Correct ?    12 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who created stl?

1112


please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html

2213


How does an stl file work?

1104


What are the various types of stl containers?

1118


How do I convert a stl file?

1043


What is a list in c++ stl?

1129


Why should a c++ programmer be interested in stl?

1040


Name the different types of stl containers.

1127


What is stl stand for?

1173


What are stl algorithms?

1124


When did c++ add stl?

1180


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

2464


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

3330


Explain stl.

1310


what is template and type convertion

2423