Eigenvalue bracketing for discrete and metric graphs