lemon/unionfind.h
changeset 2633 4f47c0f6be04
parent 2631 212ea31bf6b9
equal deleted inserted replaced
21:fb0e38d9cac0 22:6f135bba7121
  1175 	    jd = kd;
  1175 	    jd = kd;
  1176 	  } else {
  1176 	  } else {
  1177 	    int pd = nodes[jd].parent;
  1177 	    int pd = nodes[jd].parent;
  1178 	    if (nodes[nodes[jd].next].size < cmax) {
  1178 	    if (nodes[nodes[jd].next].size < cmax) {
  1179 	      pushLeft(nodes[jd].next, nodes[jd].left);
  1179 	      pushLeft(nodes[jd].next, nodes[jd].left);
  1180               if (nodes[jd].item == nodes[pd].item) {
  1180               if (less(jd, nodes[jd].next) ||
       
  1181 		  nodes[jd].item == nodes[pd].item) {
  1181                 nodes[nodes[jd].next].prio = nodes[jd].prio;
  1182                 nodes[nodes[jd].next].prio = nodes[jd].prio;
  1182                 nodes[nodes[jd].next].item = nodes[jd].item;
  1183                 nodes[nodes[jd].next].item = nodes[jd].item;
  1183 	      }
  1184 	      }
  1184 	      popLeft(pd);
  1185 	      popLeft(pd);
  1185 	      deleteNode(jd);
  1186 	      deleteNode(jd);
  1218 	    jd = kd;
  1219 	    jd = kd;
  1219 	  } else {
  1220 	  } else {
  1220 	    int pd = nodes[jd].parent;
  1221 	    int pd = nodes[jd].parent;
  1221 	    if (nodes[nodes[jd].prev].size < cmax) {
  1222 	    if (nodes[nodes[jd].prev].size < cmax) {
  1222 	      pushRight(nodes[jd].prev, nodes[jd].right);
  1223 	      pushRight(nodes[jd].prev, nodes[jd].right);
  1223               if (nodes[jd].item == nodes[pd].item) {
  1224               if (less(jd, nodes[jd].prev) ||
       
  1225 		  nodes[jd].item == nodes[pd].item) {
  1224                 nodes[nodes[jd].prev].prio = nodes[jd].prio;
  1226                 nodes[nodes[jd].prev].prio = nodes[jd].prio;
  1225                 nodes[nodes[jd].prev].item = nodes[jd].item;
  1227                 nodes[nodes[jd].prev].item = nodes[jd].item;
  1226 	      }
  1228 	      }
  1227 	      popRight(pd);
  1229 	      popRight(pd);
  1228 	      deleteNode(jd);
  1230 	      deleteNode(jd);