Correlation of structure and magnetism of AgCo nanoparticle arrays