Arriving in Madrid in May looking for Hostals in Granada and BCN

Also anyone has any info on trains from Granada to BCN

Also should I buy my ticket in the states for the Alahambra or are the lines not to long.