Structure formation in the one dimensional gravitational gas