Step-flow growth of a nanowire in the vapor-liquid-solid and vapor-solid-solid processes