Nanostructure Enabled Memristor and Supercapacitor