One function passes a pointer to the value of interest to another function.
Both functions can access the
value of interest, but the value of interest itself is not copied. This
communication is
called shallow. The alternative where a complete copy is made and sent is
known as a deep
copy.
On
int median(int arr1[],int arr2[],int N)
{
if(N==2)
{
return ((max(arr1[0],arr1[1])+ min(arr2[0],arr2[1]))/2);
}
int mid=N/2;
if(arr1[mid]==arr2[mid])
return arr1[mid];
if(arr1[mid]arr2[mid])
return median(arr1,arr2+N/2,N-N/2);
101 - 102 of 102 matches
Mail list logo