a linear-time algorithm for computing k-terminal