cout <<"Location of "<<key<<" is "<< loc+1<< endl;
}
else
{
cout <<"Sorry !"<<key<<" Doesn't exist in our database"<<endl;
}
return0;
}
Its working fine. Its really easy to understand the linear search algorithm. I don't know if we can do the same for 2D array !! will this algorithm work for 2D array also ? or will we need any other algorithm ? If you know then please share with me. I am trying myself to figure this but its not working yet. If I will success I will share the code here.