Linear time algorithms for some separable quadratic programming problems