---恢复内容开始---
while(a!=index){ //a是节点,index是a的根 int tmp=a; a=father[a]; father[a]=index; }
---恢复内容结束---
☆1107
原文:https://www.cnblogs.com/flipped415/p/10381874.html