Good improvement

Time complexity may be a little bit improve, but still O(n^2) l think;
as in worst case, the k equal to number of nodes, we should go through
all the nodes and swap all of them, which make the time complexity the
same