Precise control over morphology and density of metal and transition metal nanostructures for sensing and energy related applications