user_id; //u[i]和u[j]交换 u[i].password=u[j].password; while(i<j&&u[i].user_id>=temp)//从左向右,找第1个大于temp的u[j] {i++;} u[j].user_id=u[i].user_id; //u[i]和u[j]交换 u[j].password=u[i].password; } u[i].user_id=temp; u[i].password=temp1; QuickSortId(u,s,i-1); //左区间递归 QuickSortId(u,i+1,t); //右区间递归?}}//堆排序,建立堆voidsift(Userr[],intlow,inthigh){?inti=low,j=2*i;//j为i的左子树?inttemp=r[i].count;?stringtemp1;?temp1=r[i].password;?while(j<=high)?{ if(j<high&&r[j].count<r[j+1].count)j++;//若右子树大,则把j指向右子树 if(temp<r[j].count) { r[i].count=r[j].count;//将r[j]放到根节点上 r[i].password=r[j].password; i=j;//修改i和j,以向下筛选 j=2*i; } elsebreak;?}?r[i].count=temp;//被筛选节点放入最后位置,即最大或最小值?r[i].password=temp1;}voidsiftId(Userr[],intlow,inthigh){?inti=low,j=2*i;//j为i的左子树?inttemp=r[i].user_id;?stringtemp1;?temp1=r[i].password;?while(j<=high)?{