/* // pivots to ensure that right children are not longer than left ones int pivoth(int n) { int h=0; int tt; int lh=0; int rh=0; if((o[n]!='*')&&(o[n]!='+')) {h=0;c[n]=0;} // if leaf else { lh=pivoth(l[n]); rh=pivoth(r[n]); // pivots children and reports their heights h=max(lh,rh)+1; // height of parent }; if (rh>lh) {tt=l[n]; l[n]=r[n]; r[n]=tt;}; // swaps children if right is longer return(h); } // pivots so that consecutive nodes with the same operands for right heavy lists void pivot(int n) {int tt; if((o[n]=='*')||(o[n]=='+')) { pivot(l[n]); pivot(r[n]); if(o[n]==o[l[n]]) {tt=l[n]; l[n]=r[n]; r[n]=tt; }; }; } // swaps children when right has higher cost void pivotc(int n) { int tt; if((o[n]!='*')&&(o[n]!='+')) {c[n]=0;} else { pivotc(l[n]); pivotc(r[n]); if (c[l[n]]