Bad diets may not just wreck your waistline, but also spell doom for your brain power and memory, says a new study.