Believe that my phone is hacked

A

AC Question

I am tracked all the time. Examples looked up history searches and the are numerous sites I did not go to. In my email acts yahoo and gmail it shows a different location than mine. My root view has been deleted. I do not see my files. I am redirected in web. Apps don't work properly. There are files that start with a? Ox and cannot view. I believe my phone has been rooted. Soles will sap app false etc.
If the phone has been rooted if I reset back to factory settings will it erase code written?