I don't know that there is a formal algorithm, per se, but there is a lot of empirical data which has been rationalized by resonance, inductive, and steric effects.
What Mitch said is correct, the phenyl group will stabilize the charge if you form an enolate to the left side of the carbonyl (as you have it drawn). Phenyl groups are essential neutral in terms of withdrawing/donating ability, that is to say they can stabilize a positive or negative charge about equally via resonance.
The second molecule you have drawn there is special, however. If you were to deprotonate between the two carbonyls, you would have an anion that could be delocalized into either of the two carbonyls through resonance. This effect makes this a very stable anion and therefore the compound is very acid (relatively).
In the bascitiy question you have two different types of functional groups. You know that an amine is quite basic since it has a lone pair of electrons. Ethers, however, are not nearly as acidic because oxygen is considerably more electronegative. This ether is less basic than a normal ether because on side has an aromatic group which delocalizes the electrons from the oxygen into the ring (to a small extent).