Stalling issue

I hope someone can help me out. I have two questions. First, I recently bought a '98 Mercedes Benz. The car starts/drives great but when I put it into drive or reverse(after sitting for the night) it bogs down and usually stalls. After restarting the car two or three times, it runs. The garage fixed a sensor but that didn’t solve the problem. They said they think it is a a problem with the computer. What do you think? Second question, I know a computer problem could be expensive, is it worth fixing?