Guddu Sharma
BAN USER
Comments (3)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-2
of 2 vote
The process is called as BIOS SHADOWING.
- Guddu Sharma May 12, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
Here is a binary search approach
boolean find(arr,start,finish,data)
{
if(start==finish)
{
if(arr[start]==data)
return true;
return false;
}
if(start==finish-1)
{
if(arr[start]==data || arr[finish]==data)
return true;
return false;
}
else
{
mid=(start+finish)/2;
if(arr[mid]==data)
return true;
if(arr[mid]>arr[start])
{
if(data>=arr[start] && data<arr[mid])
find(arr,start,mid-1,data);
else
find(arr,mid+1,finish,data);
}
else
{
if(data>arr[mid] && data<=arr[finish])
find(arr,mid+1,finish,data);
else
find(arr,start,mid-1,data);
}
}
}
Please comment if any corner cases are left.
- Guddu Sharma May 05, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
A memory leak refers to the memory which cannot be accessed. More simply, The pointer which was pointing to the memory has been destroyed.
- Guddu Sharma May 12, 2012