Sort the elements - Complexity $\theta\large{(nlogn)}$
Set two pointers, low=array[1] , high=array[n]
func(check)
{
while(low!=high)
{
if(array[low]+array[high]>x)
{
high=high-1;
}
else
if(array[low]+array[high]<x)
{
low=low+1;
}
else
return true;
}
return false;
}