why dont we try to calculate the second case??

in the second case, my first task is to find where is the eq position.

mg=k x0, ie x0=mg/k is the equilibrium elongation.

let spring be further displaced by y.

so new equation of motion is

m a= mg-k(y+x0)

so, ma=mg-ky-kx0=-ky(since we had the relation kx0=mg at eq)

note that this is just the shm eq. so w=root k/m

hence frequency and T remains same.