1. A resistive-switching memory element comprising: a resistive-switching layer; and a diode; wherein the resistive-switching layer is configured to switch between a high resistive state and a low resistive state in response to a transient pulse of electrical current in a first direction; wherein the diode is connected in series with the resistive-switching layer; and wherein the diode is configured to allow the electrical current to flow in the first direction through the resistive-switching layer during the transient pulse.