Interplay of the atomic and electronic structure in liquid and amorphous metals and alloys