1. A method comprising: forming a first conductive layer having a first most prevalent metal; forming a resistive switching nonstoichiometric metal oxide layer over the first conductive layer having a second most prevalent metal, wherein the first most prevalent metal and the second most prevalent metal are the same; forming a second conductive layer over the metal oxide layer; and forming an ohmic contact between the first electrode and the metal oxide and forming a Schottky contact between the second electrode and the metal oxide.