Resampling and genealogies in sequential Monte Carlo algorithms