Andre
For diagram 1 work out the parallel network resistance and using the 1A calculate the voltage across the network, take this voltage away from the supply and that is the voltage across r, then it is ohm law again to work out r.
For diagram 2 uses ohm's law for the 20 ohms and 0.5A then this voltage can by taken away from supply to work out voltage across 5 ohms. For the 5 ohms calculate I then take 0.5A away from it and you now have I and V across r, simple ohms law again to work out r.
Hope this helps.