All demented patients are checked for vitamin B12 deficiency bc this is a curable dementia. But it is not a very common cause of dementia. They only have dementia. Usually vitamin B12 deficiency presents as pernicious anemia. This is also reversible.
Cause of dementia is probably due to the thyroid's affect on cerebral metabolism.
Sometimes meningitis can present not with the classic triad of fever, stiff neck and headache, but as dementia. Tumors in posterior fossa can block CSF flow and cause hydrocephalus. Patient will complain of not thinking or functioning well. Astrocytomas that cross the corpus collosum can also present as dementia. Apparently interrupting the corpus collosum produces dementia.